March 2001
Intermediate to advanced
480 pages
14h 8m
English
This
code is used to run a program, which can
be a DOS program, a Windows application, an Internet or mailto URL,
or anything else you might normally type in the Start Menu’s
Run command.
Place this subroutine in your scripts:
Sub RunProgram(Filename, Wait)
Set WshShell = WScript.CreateObject("WScript.Shell")
RetVal = WshShell.Run(Filename, Wait)
End Suband call the routine like this:
Call RunProgram("c:\windows\notepad.exe", True)You can replace True with False
if you don’t want to wait for the program to finish before the
next script command is executed.