What is the difference between cscript and wscript? Which is best for doing Telnet and FTP automation in Windows?
What is the difference between cscript and wscript? Which is best for doing Telnet
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Windows, an executable is either a console application or a Windows application (or a SFU or Native application, but that doesn’t matter here).
The kernel checks a flag in the executable to determine which.
When starting using
CreateProcessWinAPI function, if it is a console application, the kernel will create a console window for it if the parent process doesn’t have one, and attach theSTDIN,STDOUTandSTDERRstreams to the console.If it is a Windows application, no console will be created and
STDIN,STDOUTandSTDERRwill be closed by default.WSCRIPT.EXEandCSCRIPT.EXEare almost exactly identical, except that one is flagged as a windows application and the other is flagged as a console application (Guess which way around!).So the answer is: If you want your script to have a console window, use
CSCRIPT.EXE. If you want it to NOT have a console window, useWSCRIPT.EXE.This also affects some behaviors, such as the WScript.Echo command. In a
CSCRIPT.EXEthis writes a line to the console window. InWSCRIPT.EXEit shows a messagebox.For your application I suggest
CSCRIPT.EXE. I think you should also look at PuTTY and PLink, and you should also see this here: