To run scripts using the Windows-based script host (Wscript.exe)

You can run scripts with the Windows-based script host in the following ways:

By browsing in Windows

Browse to the folder containing the script you want to run and double-click it. Script files can be listed in My Computer, Windows Explorer, the Find window, the Start menu, or on your desktop.

By using the Run command

Click Start, and then click Run. In Open, type the name of the Windows Host executable file (Wscript.exe), followed by a space, then the full path name of the script you want to run. Be sure to include the file name extension of the script file. Click OK to start the script.

From a command prompt window

At the command prompt, type the name of the Windows Host executable file (Wscript.exe), followed by a space, then the full path name of the script you want to run. Be sure to include the file name extension of the script file. Press Enter to start the script.

Note

Windows scripts are files with the following file name extensions: .wsf, .vbs, .js.

If you double-click a script file whose extension has not been associated with Wscript.exe, the Open With dialog box appears. Select Wscript.exe, then select Always use this program to open this file type. This registers Wscript.exe as the default script host for files of this file type.

You can use the Windows Script Host Settings dialog box to set global scripting properties for all scripts that Wscript.exe runs on the local computer 

You can set properties for individual scripts. See Related Topics for information about how to do this.

You can also use Windows Script Host to create .wsf script files, with which you can call multiple scripting engines and perform multiple jobs, all from one file.

Related Topics

Download Windows Script Host samples

Windows Script Host object model

Windows Script Host overview

Run scripts using the command-line-based script host (cscript.exe)

Run scripts using the Windows-based script host (Wscript.exe)

Run Windows Script Host samples

Set global properties for all scripts that are run with the Windows-based script host (Wscript.exe)

Set properties for individual scripts that are run with the Windows-based script host (Wscript.exe)

For more information, see the Windows Script Technologies Web site at the Microsoft Web site.



© 2016 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies