|
下面两种结果都一样
第一种
SystemUtil.Run "cmd.exe","","C:\WINDOWS\system32","open"
'打开CMD .EXE 目录为 C:\WINDOWS\system32
Window( "object class:=ConsoleWindowClass" ).Type "Ping www.51testing.com"
'在CMD 输入 Ping www.51testing.com
Window( "object class:=ConsoleWindowClass" ).Type micReturn
txt = Window( "object class:=ConsoleWindowClass" ).GetVisibleText()
print txt
'按回车键 执行 输入的 Ping www.51testing.com
第二种
Dim wShell, exec
Set wShell = CreateObject( "WScript.Shell" )
Set exec = wShell.Exec( "%comspec% /C ping advancedqtp.com" )
print exec.StdOut.ReadAll |
|