WSCRIPT and CSCRIPT Commands: Syntax, Parameters, Examples

-

|

Introduction

WSCRIPT is the Windows-based version of Windows Script Host while CSCRIPT is the command-prompt-based version. This guide takes a detailed look at both versions – including Syntax and Parameters and examples.

WSCRIPT Command Line Syntax

WSCRIPT

The syntax of WSCRIPT is shown below:

WSCRIPT [<scriptname>] [/B] [/D] [/E:] [{/H:CSCRIPT |/H:WSCRIPT }] [/I] [/job:<WSF-Job>] [{/logo|/nologo}] [/S] [/t:<number>] [/X] [/?] [<Script Arguments>]

The next section explains the meaning of each parameter in the syntax.

WSCRIPT Parameters Explained

The table below explains the parameters shown in the WSCRIPT Syntax.

S/NParameterDescription
1<scriptname>Specifies the full path and name of the script
2/B*Runs the script in batch mode.
3/DStarts the debugger.
4/E**Allows you to specify the engine to use in executing the script
5/H:CSCRIPT Registers CSCRIPT to run scripts by default.
6/H:WSCRIPT***Changes the default script host to WSCRIPT
7/IRuns the script in interactive mode (default). This is the opposite of /b parameter.
8/job:<WSF-Job>Runs the specified WSF job
9/logoDisplays logo
10/nologoSpecifies not to display the Windows script file logo
11/SSaves the current command prompt options for the logged in user
12/t:<number>****Specifies how long the script is allowed to run before it is timed out. By default the script will run indefinitely.
13 /XStarts the script in the debugger.
14 /?Displays WSCRIPT help
*Batch mode stops WSCRIPT from displaying alerts, scripting errors, or input prompts.
**Using the /e switch allows you to execute a script with custom file extensions. Without specifying the /e parameter, if you double-click a file with an unknown file extension you will receive an error message.
***By default Windows will run scripts with WSCRIPT
****You can specify up to 32,767 seconds.

WSCRIPT Examples

In this section I will show you some examples and applicable use of WSCRIPT.

To get Windows to execute scripts with CSCRIPT by default, run this command:

WSCRIPT /h:CSCRIPT
WSCRIPT Examples - change default windows script file to CSCRIPT

To run a VBScript, WSCRIPT-Test.abs (with a custom file extension), type the command below. Then press Enter.

WSCRIPT C:\Scripts\WSCRIPT-Test.abs /e:VBScript 

CSCRIPT Syntax

CSCRIPT Syntax

The syntax of CSCRIPT is shown below

CSCRIPT <Scriptname.extension> [/B] [/D] [/E:] [{/H:cscript|/H:wscript}] [/I] [/Job:] [{/Logo|/NoLogo}] [/S] [/T:] [/X] [/U] [/?] [<ScriptArguments>]

CSCRIPT Parameters

The parameters of the CSCRIPT command are exactly the same as those of the WSCRIPT commands, with the exception of /U parameter. Click WSCRIPT Parameters Explained for the parameters.

The /U parameter of CSCRIPT specifies to use Unicode for redirected I/O from the console

CSCRIPT Examples

To execute a VBScript and display a banner, execute the command below:

CSCRIPT C:\Scripts\CSCRIPT-Test /logo 

To specify a timeout for the script, run the command below:

CSCRIPT C:\Scripts\CSCRIPT-Test /T:1200
In the previous command the script will terminate after 20 minutes (1200 seconds)

Conclusion

I hope this guide has been helpful. If you have any question or comment, use the “Leave a Reply” form at the end of the page. Alternatively, you could share your experience so other readers can benefit from it.

Other Helpful Guides

Additional Resources and References

  • Was this post Helpful?
  • YesNo

LEAVE A REPLY

Please enter your comment!
Please enter your name here

ADVERTISEMENTS

FEATURED POSTS

Best Christian Movies on Netflix

The 10 Best Christian Movies on Netflix

This Itechguide reviews the 10 best christian movies on Netflix. The movies are listed in reverse order – with the 10th movie...
How to Change Orientation in Google Docs

How to Change Orientation in Google Docs

This Itechguide teaches you how to change orientation in Google Docs. The guide covers steps to change orientation in Google Docs from...
How to Delete Google Photos

How to Delete Google Photos

This Itechguide teaches you how to delete Google Photos. The guide offers steps to delete Google Photos from the Google Photos App...
How to Install Windows 10 1909 Update Manually

How to Install Windows 10 1909 Update Manually

This Itechguide teaches you how to install Windows 10 1909 update manually. Windows 10 1909 (otherwise known as Windows 10 November update)...
How to Create a Poll on Facebook

How to Create a Poll on Facebook

This Itechguide teaches you how to create a poll on Facebook. You can create a poll on Facebook from a Facebook page...

AMAZON DEALS

TRENDING POSTS

Remote Desktop Connection

Remote Desktop Connection an Internal Error Has Occurred [Fixed]

Introduction I recently received the error message "Remote Desktop Connection an Internal Error Has Occurred". It was strange because...

Find My Samsung: Register and Use Samsung Find my Mobile

Introduction Ever wondered how you could find your Samsung phone if you lost it? Find my Samsung or Samsung...
What is the Difference Between PowerShell and CMD?

Windows Powershell vs CMD: Differences and Similarities

Introduction This short guide compares Windows PowerShell vs CMD (Windows command prompt). I will cover the history and nature...
Spotify No Longer Supports this Version of Microsoft Edge

Spotify No Longer Supports this Version of Microsoft Edge [Fixed]

Introduction When you open Spotify web player on Microsoft Edge, you may receive the error message "Spotify No Longer...
Windows 10 Won't Boot

Windows 10 Won’t Boot With Black Screen? 3 Ways to Fix It

Why Won't Windows 10 Boot Up? If your Windows 10 stops with a black screen, the first question in...

ADVERTISEMENTS

BEST OF ITECHGUIDES

foreach in file powershell

How to Iterate the Content of a Text File in Powershell in 2 Easy...

Introduction If you have a text file with data you wish to use, you can use PowerShell Get-Content ...
The 10 Best Korean Movies on Netflix

The 10 Best Korean Movies on Netflix

Korean movies are making wave in the movie world globally. There are several Koreans movies on Netflix with different genre.

iTechGuides’ Top 10 Online Games

The gaming world is getting bigger day by day. Many people are getting engaged to play online games worldwide.
How to Pin a Post on Facebook from Desktop or Mobile Phone

How to Pin a Post on Facebook from Desktop or Mobile Phone

This guide demos how to pin a post on Facebook. It offers steps to pin a post from a desktop or a...
How to Create a Poll on Facebook

How to Create a Poll on Facebook

This Itechguide teaches you how to create a poll on Facebook. You can create a poll on Facebook from a Facebook page...

RECENT POSTS

How to Change Facebook Page Name

How to Change Facebook Page Name

This Itechguide teaches you how to change Facebook page name. The guide covers steps to change Facebook page name from a PC...
How to Change YouTube Channel Name

How to Change YouTube Channel Name

This Itechguide teaches you how to change YouTube channel name. The guide covers steps to change YouTube channel name from a PC.
How to Bold Text on Facebook Post

How to Bold Text on Facebook Post

This Itechguide teaches you how to bold text on Facebook post. The guide covers steps to bold text on Facebook post from...
Best Crime Documentaries on Netflix

The 10 Best Crime Documentaries on Netflix

This Itechguide reviews the 10 best crime documentaries on Netflix. The documentaries are listed in reverse order – with the 10th documentary...
Best Netflix Series

The 10 Best Netflix Series

This Itechguide reviews the 10 best Netflix series. The series are listed in reverse order – with the 10th series on top....

AMAZON DEALS

MUST READ

C:\G-Drive\Work Tools\Products Portal\1. New Business\2. Content Sites\1. iTechGuides.com\Posts\2. FIX IT\Microsoft\Windows 10\remote desktop can't connect to the remote computer

How to Fix “Remote Desktop Can’t Connect to the Remote Computer”

Introduction Recently, I tried to RDP to a computer and received the error message "Remote Desktop can't connect to...
How to Change Administrator Name in Windows 10 (4 Methods)

How to Change Administrator Name in Windows 10

Introduction This guide demos how to change administrator name in Windows 10. There could be...

How to Install IIS in Windows 10 (3 Methods)

Introduction This guide demos 3 methods to install IIS in Windows 10. IIS (Internet Information Services) is a Windows...
windows server 2016 router configuration

How to Configure Windows Server 2016 as a Router

Introduction This guide demos Windows Server 2016 router configuration. It walks you though how to configure Windows Server 2016...
how to share screen on skype

How to Share Screen on Skype on Desktop and Mobile Apps

Introduction What determines how you share screen on Skype depends on a number of factors: Where...

AMAZON DEALS

By using this website you agree to accept our Privacy Policy and Terms & Conditions