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

Pacerier picture Pacerier · Apr 26, 2011 · Viewed 12.6k times · Source

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

What's the difference between these two options?

Answer

paxdiablo picture paxdiablo · Apr 26, 2011

One major difference is that cscript runs within a console, wscript does not.

If you want console-like output, use cscript. In that mode, printing will result in output to the console. That same printing in wscript send its output to dialog boxes:

wscript.echo "hello"