Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
January 5, 2000
A. Its possible to run a DOS command from inside a WSH program usingthe following:
DIM objShell
set objShell = wscript.createObject("wscript.shell")
iReturn = objShell.Run("cmd.exe /C set var=hello", 1, TRUE)
You could use %Comspec% variable instead of cmd.exe if you wish. The /C closesthe command window after the command is completed. The actual command set var=hellojust creates an environment variable called var set to hello.
You May Also Like