Exec
Exec allows you to execute command line applications. It requires the WshShell Object.
The advantage of using Exec over RUN, is that exec allows you more flexibility over handling the output generated by command line applications.
This example simply runs the IPConfig command and displays the output on the screen.
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("ipconfig")
Set objStdOut = objWshScriptExec.StdOut
strOutput = objStdOut.ReadAll
WScript.Echo strOutput
Become a Member
Start learning about VBScript right now!
Become a Member and begin downloading our VBScript Videos Immediately!
These VBScript Videos are from our VBScript Product
|