Should we use CScript.exe or WScript.exe to run .vbs files?

VBScript files (.vbs) can be run using either cscript.exe or wscript.exe.

What is the difference between these two options?

+18
vbscript wsh
Apr 26 '11 at 9:16
source share
2 answers

One significant difference is that cscript works inside the console, wscript does not work.

If you need console output, use cscript . In this mode, printing will output to the console. The same print in wscript sends its output to the dialog boxes:

 wscript.echo "hello" 
+24
Apr 26 '11 at 9:18
source share

Using cscript, it displays information in the cmd window, which will not stop the script. when using Hscript, information that stops the script will be displayed

+3
Apr 7 '15 at 7:02
source share



All Articles