金融网销好做还是电销:Exec Method (Windows Script Host)

来源:百度文库 编辑:九乡新闻网 时间:2024/04/26 20:01:32

Exec Method (Windows Script Host)

Windows Scripting 5.8

Runs an application in a child command-shell, providing access to the StdIn/StdOut/StdErr streams.

                      object.Exec(strCommand)
Arguments
object

WshShell object.

strCommand

String value indicating the command line used to run the script. The command line should appear exactly as it would if you typed it at the command prompt.

Remarks

The Exec method returns a WshScriptExec object, which provides status and error information about a script run with Exec along with access to the StdInStdOut, and StdErr channels. The Exec method allows the execution of command line applications only. The Exec method cannot be used to run remote scripts. Do not confuse the Execmethod with the Execute method (of the WshRemote object).

Example

The following example demonstrates the basics of the Exec method.

Dim WshShell, oExecSet WshShell = CreateObject("WScript.Shell")Set oExec = WshShell.Exec("calc")Do While oExec.Status = 0     WScript.Sleep 100LoopWScript.Echo oExec.Status
VBC#C++F#JScript
No code example is currently available or this language may not be supported.

Applies To:

WshShell Object

See Also

Reference

WshScriptExec Object