Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open Command Prompt, then run the script with Windows Script Host’s command-line executable:

cscript C:\Path\To\script.vbs

For example, if the file is in C:\Scripts:

cscript C:\Scripts\backup.vbs

cscript.exe runs the script in the console, so output appears in the Command Prompt window. Running a VBScript this way does not require an administrator account.

Run a VBS file from Command Prompt

  1. Open the Start menu or Start screen and type cmd.
  2. Select Command Prompt.
  3. Run the script with cscript and the script’s full path: cscript C:\Path\To\script.vbs

Replace the example path with the actual location and file name. Microsoft’s command-line example is cscript vbscript.vbs. Microsoft’s example and explanation notes that script output appears in the command window.

If the script displays a message box or requests input, it may need interactive behavior instead of batch mode.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.

Run the script after changing to its folder

You can first move to the directory containing the file, then run it by name:

cd /d C:\Scripts
cscript backup.vbs

The /d switch lets cd change drives as well as folders. For example, it can move from the current drive to D::

cd /d D:\Automation
cscript daily-task.vbs

Changing folders is optional. Using the full path with cscript does the same job without changing the current Command Prompt directory.

Use quotes when the path contains spaces

Put the complete path in quotation marks if a folder or file name contains spaces:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cscript “C:\Users\Alex Smith\Documents\Scripts\report.vbs”

Without the quotes, Command Prompt treats the space as the end of the script path and usually reports that it cannot find the specified file.

Use wscript for interactive execution

cscript.exe is the command-line host. wscript.exe is the interactive Windows Script Host and is more suitable for scripts that use dialog boxes or other graphical interaction:

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites

wscript C:\Path\To\script.vbs

The practical difference is:

Command Typical behavior
cscript Runs in the console; script output is shown in Command Prompt.
wscript Runs interactively; scripts can use Windows dialog boxes without console output being the main interface.

For a script that uses WScript.Echo, cscript generally displays the message in the console, while wscript presents it interactively.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Useful cscript options

Options go after the script name. These are the switches most useful from Command Prompt:

Command Purpose
/nologo Hides the Windows Script Host banner.
/b Enables batch mode and suppresses alerts, scripting errors, and input prompts.
/i Uses interactive mode, which is the default and is the opposite of /b.
/t:60 Stops the script if it runs longer than 60 seconds.
/e:VBScript Specifies the VBScript scripting engine.
/? Displays cscript syntax and available options.

For a clean console command, use:

cscript C:\Scripts\backup.vbs /nologo

For a non-interactive job:

cscript C:\Scripts\backup.vbs /b /nologo

Important: /b does not mean “run in the background.” It means batch mode. It suppresses prompts and errors that would otherwise be displayed interactively. Do not use it while troubleshooting a script that may need to show an error or ask for input.

To impose a one-minute time limit:

cscript C:\Scripts\backup.vbs /t:60

The default is no time limit. The maximum value accepted by /t is 32,767 seconds. If the limit is exceeded, cscript interrupts the script engine and ends the process.

Pass arguments to the VBS script

Place script arguments after the script path:

cscript C:\Scripts\convert.vbs /input:C:\Files /format:csv

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The arguments are received by the VBScript through the Windows Script Host argument collection. Under the documented cscript syntax, each script argument is preceded by /, and you cannot provide script arguments without naming a script first.

Host options and script arguments can be combined. For example:

Rank #3
Sale
ProtoArc XK01 Full-Size Foldable Bluetooth Keyboard for Travel, Black
  • True Full-Size Typing: 105 keys, 0.65in keycaps, a number pad, function row, and navigation keys deliver a desktop-style typing experience for travel, office, and remote work
  • Tri-Fold Travel Design: The keyboard folds to 8.46 x 4.68 x 0.78 in, with internal aluminum hinges tested for 10,000+ folds and a no-clip design for quick setup
  • 3-Device Bluetooth Switching: Bluetooth 5.1 connects up to three devices and switches with one button, helping you move between laptop, tablet, and phone without breaking workflow
  • USB-C Rechargeable Standby: Recharge with the included USB-C cable and rely on auto-sleep standby up to 150 days, so the travel keyboard is ready when your work moves
  • Quiet Scissor-Switch Keys: Low-profile scissor switches reduce typing noise in coffee shops, open offices, and shared rooms while keeping each keystroke comfortable and controlled

cscript C:\Scripts\convert.vbs /nologo /input:C:\Files /format:csv

Make sure your script distinguishes host options from its own arguments if it expects names such as /input or /format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Specify the VBScript engine

A normal .vbs file is identified by its extension. You can explicitly select the VBScript engine with /e:VBScript:

cscript C:\Scripts\check.vbs /e:VBScript

This is particularly useful when a script uses a nonstandard file extension. Windows Script files can also use extensions such as .wsf and .js; do not assume that every Windows Script Host file is VBScript.

Get help for cscript

Run:

cscript /?

With no script or script arguments, cscript.exe displays its command-line syntax and valid host options. Its complete syntax is:

cscript <scriptname.extension> [/b] [/d] [/e:<engine>] [{/h:cscript | /h:wscript}] [/i] [/job:<identifier>] [{/logo | /nologo}] [/s] [/t:<seconds>] [x] [/u] [/?] [<scriptarguments>]

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

By contrast, running wscript without a script opens the Windows Script Host Settings dialog box rather than showing command-line help. See Microsoft’s cscript documentation and wscript documentation.

Rank #4
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later

If Windows opens “Open With”

If you double-click a script extension that has no file association, Windows displays an Open With dialog. Select wscript or cscript, then select Always use this program to open this file type.

You do not need to change the association just to run a file from Command Prompt. Calling cscript directly selects the command-line host for that invocation.

Windows normally leaves wscript.exe registered as the default script host. The host registration can be changed with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cscript script.vbs /h:cscript

To register the interactive host instead:

cscript script.vbs /h:wscript

Omitting /h: does not change the registered default.

Common errors and fixes

Symptom Likely cause Fix
“Input line is too long” or the file is not found The path contains spaces and was not quoted. Use cscript “C:\Path With Spaces\script.vbs”.
“Cannot find script file” The path or file name is wrong, or you are in the wrong folder. Use the full path, or run cd /d to the script’s folder first.
The command displays errors that you cannot see /b suppressed scripting errors. Remove /b while testing.
The script appears to stop waiting It may be waiting for input or displaying an interactive prompt. Run it without /b, or use wscript if it is designed for dialog-based interaction.
The script runs but no console output appears The script may use graphical dialogs, or it may not write output. Try wscript for interactive behavior, or inspect the script’s output commands.
Access is denied The script is trying to access a protected file, folder, registry location, or system resource. Check the specific operation and its permissions. Running the script itself does not automatically require administrator credentials.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Is VBScript still available in Windows?

VBScript is deprecated for Windows client. Microsoft’s deprecation entry is dated October 2023 and says VBScript will become a Feature on Demand before eventual removal. Microsoft has not published a specific removal date in the cited current documentation. See Microsoft’s deprecated-features documentation.

That does not mean VBScript has already been removed from every current Windows installation. Microsoft’s current cscript and wscript documentation still lists Windows 10, Windows 11, and supported Windows Server versions. Microsoft separately states that VBScript is available as a Feature on Demand in Windows Server 2025 and is preinstalled there before removal in a later release. See Microsoft’s Windows Server feature status.

For new automation, consider whether a supported alternative is more appropriate. For an existing .vbs file, the commands above are the standard Windows Script Host methods while the component remains available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Wireless Keyboard and Mouse Combo, Full Size Silent Ergonomic Keyboard and Mouse, Long Battery Life, Optical Mouse, 2.4G Lag-Free Cordless Mice Keyboard for Computer, Mac, Laptop, PC, Windows
  • 【Ergonomic Wireless Keyboard Mouse 】: Wireless ergonomic keyboard is equipped with adjustable height tilt legs to increase comfort and prevent your wrists injury when typing for a long time. The full size wireless keyboard with numeric keypad and 12 multimedia shortcut keys, such as play/ pause, volume increase and decrease, and email, to help you improve work efficiency
  • 【Stable & Reliable Wireless Connection】: This wireless keyboard and mouse combo share the same USB receiver(stored in the mouse), and they can also be used separately. Plug & play, no need to download any software, 2.4 GHz wireless provides a powerful and reliable connection up to 33 feet(10m) without any delays.You can enjoy the convenience and freedom of wireless connection at home or at work
  • 【Comfortable Optical Mouse】: This compact lightweight wireless mouse features a hand-friendly contoured shape for all-day comfort, and smooth, precise tracking.1600 DPI to meet your daily needs. Perfect for home & office work and entertainment
  • 【Long Battery Life】: Up to 365 Days of battery life for keyboard and mouse wireless, say goodbye to the hassle of charging cables and replacing batteries. After 10 minutes of inactivity, the wireless keyboard mouse combo will automatically go into sleep mode to save energy. The wireless keyboard requires one AAA battery, and the wireless mouse requires one AA battery.
  • 【Less Noise, More Quiet Keys】: Soft membrane keys provide a quiet and comfortable typing experience, So you can type with confidence on a wireless keyboard crafted for comfort, precision and fluidity. The wireless mouse adopts silent micro-motion technology, which is almost completely silent when clicked. No more concerns about disturbing others.

FAQ

Do I need to run Command Prompt as administrator to run a VBS script?

No. Running a VBScript through cscript or wscript does not itself require administrative credentials. The script may still need elevated permissions for particular operations, such as modifying protected system locations.

What is the simplest command to run a VBS file?

Use cscript followed by the file path: cscript C:\Scripts\script.vbs.

Should I use cscript or wscript?

Use cscript when you want console-based execution and output in Command Prompt. Use wscript when the script is designed for interactive Windows dialogs.

How do I stop the Windows Script Host logo from appearing?

Add /nologo: cscript C:\Scripts\script.vbs /nologo.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I run a VBS script without prompts?

Add /b for batch mode: cscript C:\Scripts\script.vbs /b. This suppresses alerts, scripting errors, and input prompts, so it is usually better to omit it during troubleshooting.

How do I set a time limit for a script?

Use /t: followed by seconds, such as cscript C:\Scripts\script.vbs /t:60. The maximum is 32,767 seconds; the default is no time limit.

Has Microsoft already removed VBScript from Windows?

Not as a general statement. Microsoft describes VBScript as deprecated and planned for eventual removal, but current documentation still covers cscript and wscript on current Windows versions. Microsoft has not specified a removal date in the cited documentation.

The Bottom Line

For most cases, open Command Prompt and run:

cscript “C:\Path\To\script.vbs”

Add /nologo for cleaner output, /b for batch mode, or /t:60 for a 60-second limit. Use wscript instead when the script requires interactive windows or dialog boxes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
SaleBestseller No. 4
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.