If you explicitly specify a host (e.g., when you preface the script's name with either the Cscript or Wscript command), you must also type the script's file extension. For example, the command
cscript hello
won't work, but
cscript hello.vbs
will (assuming, of course, that a script file named hello.vbs exists in the current directory). Typing a script name without a host or an extension at the command prompt causes the default host to execute the script.
To see which is the current default scripting host, right-click a script file in Windows Explorer. If the bold menu item is Open with Command Prompt, then the default host is CScript. If the bold menu item is Open, the default host is WScript.
Script File Properties
You can open a Properties dialog box for a script file by right-clicking the script file in Windows Explorer and choosing Properties. Go to the Script tab, which Figure 1 shows. The two options on this tab correspond to the //T and //Logo (or //Nologo) command-line options. If you change either of the options and click OK, Windows creates scriptname.wsh in the same directory as the script. The .wsh file is a plaintext file that contains the selected options; Figure 2 shows a sample .wsh file. The sample .wsh file's BatchMode setting isn't accessible via the GUI and corresponds to the //B command-line option. When it's set to zero (the default), the script will run in interactive mode (//I); if set to 1, the script will run in batch mode (//B). If you want to use this setting, you'll need to open the .wsh file in Notepad or another editor and add the setting. . . .