Cscript command in Windows
The cscript command starts a script to run in the command line environment.
- Applies to : Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.
The cscript command starts a script to run in the command line environment.
Syntax cscript command
cscript [/B] [/D] [/E:] [{/H:cscript|/H:wscript}] [/I] [/Job:] [{/Logo|/NoLogo}] [/S] [/T:] [/X] [/U] [/?] []
Parameters
ParameterDescriptionScriptname.extension Specifies the path and name of the script file with the optional extension. / B Specify the batch mode, this mode does not display warnings, script errors, or import prompts. / D Start the debugger. / E: Specify the tool used to run the script. / H: cscript Register cscript.exe as the default server to run the script. / H: wscript Register wscript.exe as the default server to run the script. This is the default option. / I Specifies the interactive mode, alert display, script error and prompt to enter. This is the default option and vice versa . / Job: Run the task identified by Identifier in the .wsf script file. / Logo Specifies that the Windows Script Host banner is displayed in the control panel before the script runs. This is the default option and vice versa . / Nologo Specifies that the Windows Script Host banner is not displayed before the script runs. / S Save command prompt options for the current user. / T: Specify the maximum time that the script can run (in seconds). You can specify up to 32,767 seconds. The default is not limited to time. / U Specifies Unicode for input and output to be redirected from the console. / X Start the script in the debugger. /? Show available command parameters and provide help to use them. This is like typing cscript.exe without parameters and no script. ScriptArguments Specifies the arguments passed to the script. Each script argument must have a slash ( / ).Note when using cscript command
- Performing this task does not require you to have administrative login information. Therefore, for best security, consider executing this task as a user without administrative login information.
- To open a Command Prompt, on the Start screen , enter cmd, then click the command prompt .
- Each parameter is not required. However, you cannot specify script arguments without assigning scripts. If you do not specify a script or any script argument, cscript.exe displays the syntax of cscript.exe and valid server options.
- The / T parameter prevents running too many scripts by setting a timer. When the runtime exceeds the specified value, the cscript command interrupts the script tool and terminates the process.
- Windows script files often have one of the following file name extensions: .wsf, .vbs, .js.
- You can set properties for each script.
- The Windows Script Host can use .wsf script files. Each .wsf file can use many scripting tools and perform many tasks.
- If you double-click the script file whose extension has no link, the Open With dialog box will appear. Choose wscript or cscript, then select Always use this program to open this type file . This registers wscript.exe or cscript as the server that stores the default script for files of this type.
See more:
- Compact command in Windows
- The convert in Windows command
- Comp command in Windows
4.3 ★ | 4 Vote
You should read it
Maybe you are interested
5 Free AI Tools That Will Save You a Lot of Money on Service Subscriptions
Microsoft 365 Android PDF Viewer shows ads, even with subscription
This PowerShell script can bypass Windows 11 system requirements, Microsoft Account
How to execute Shell script in Linux
This is why people cancel their X Premium subscription!
Learn about Shockwave Unlimited: Subscription that replaces Game Pass and PS Plus