Windows Script Host enables you to run scripts from the command prompt. CScript.exe provides command-line switches for setting script properties.
Step 1: Open notepad in your pc. “Activate Windows 10 free Using a batch file” is published by HEYNIK in CyberXERX. A.vbs extension is an extension associated with VBScript files. VBScript is a scripting language for Microsoft. In layman's speak, VBScript is capable of communicating and issuing commands to your PC's Microsoft Windows operating system via a certain set of codes. The Run method starts a program running in a new Windows process. You can have your script wait for the program to finish execution before continuing. If a file type has been properly registered to a particular program, calling run on a file of that type executes the program. There is not a 'write to log file in case you have an error' function in VBScript. However, you can run your VBScript script using a shell script (batch file) using cscript.exe and use 2 to redirect run-time errors to a file. To run a VBS file when a service fails, specify command= Cscript Drive: MyScript.vbs, where Drive: MyScript.vbs is the fully qualified name of the script file. You can specify up to three separate actions with the actions= parameter, to be used the first, second, and third times that a service fails.

To run scripts using CScript.exe
How To Run Vbs File From Cmd
Type a command at the command prompt using the following syntax:
Host Options enable or disable various Windows Script Host features. Host options are preceded by two slashes (//).Script name is the name of the script file with extension and necessary path information, for example, d:adminvbscriptschart.vbs. Script options and parameters are passed to the script. Script parameters are preceded by a single slash (/).
Run Vbs File From Cmd

How To Run .vbs File Through Command Prompt
Each parameter is optional; however, you cannot specify script options without specifying a script name. If you do not specify parameters, CScript displays the CScript syntax and the valid host parameters.
Several sample scripts, which are installed along with Windows Script Host, are also available for download at (
Suppose, for the purposes of this example, that you have copied the Chart.vbs sample script to the following folder on your computer:
You can run the script with and without a logo as follows.
To run a script with or without a logo
Start the MS-DOS command prompt.
Enter the following commands at the command prompt (modify accordingly if your sample scripts are located in a different folder):
Concepts
Running Scripts from WindowsWhat to Include to Run a Script
WScript.exe and CScript.exe Options
