Dashboard > People > Jim Hamilton > Home > Fun with WSH
  Jim Hamilton Log In   View a printable version of the current page.  
  Fun with WSH
Added by Jim Hamilton, last edited by Jim Hamilton on Jul 10, 2007  (view change)
Labels: 
(None)

Windows Script Host (WSH) is available on most Windows machines and will run Visual Basic Scripting Language (VBScript) programs. To determine if it is installed, open a CMD (DOS) window and type "cscript" or "wscript" at the prompt. If nothing happens or the following error messages result, then it's probably not installed:

'cscript' is not recognized as an internal or external command,
operable program or batch file.
'wscript' is not recognized as an internal or external command,
operable program or batch file.

Copy the following code using Notepad and save it into a handy directory as "hello.vbs" (or use "Edit" from the CMD window you may already have open):

WScript.Echo "Hello World!"

Open a CMD window (if not already still open) and navigate to the directory with the "hello.vbs" file. Type "cscript hello.vbs" and you should be rewarded with:

Hello World!

Type "wscript hello.vbs" and you should be greeted with

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.5 Build:#520 Jun 27, 2006) - Bug/feature request - Contact Administrators
This wiki is a joint endeavor of the GCIS Group and the Faculty Connection Center at Glendale Community College.
We welcome feedback.  Legal Notice