| Writing a script is easy. Lets start with the obligitory Hello World example. Start Notepad and enter the following text - Wscript.Echo "Hello World" Save the file as hello.vbs (Note: Notepad will try and save as .txt so you may have to rename the file extension) WSH provide 2 ways to execute scripts. - WScript.exe - Runs the script in GUI window mode
- CSCript.exe - Runs the script in a DOS like shell window
By default, WSH associate WScript.exe with the scripting extensions (.vbs .vbe .js .jse .wsf) which means that you can double click your script file from the Windows Explorer which will give the following result... To run the script in command line mode, start a DOS (CMD for NT) window and type the following command... cscript c:/full path to your script file/YourFileName.vbs Which should produce the following output...  That wasn't so hard, was it? Next we we look at more detailed options for running scripts. |