===================================================================
‘使用WshShell 的 Exec方式:
‘ping 操作,并获得回显
set objshell=createobject("wscript.shell")
Set exec = objshell.Exec( "%comspec% /C ping baidu.com" )
print exec.StdOut.ReadAll
‘删除路径下所有后缀为dat的文件
set objshell=createobject("wscript.shell")
Set exec = objshell.Exec( "%comspec% /c del C:\Users\Administrator\Downloads\*.dat" )
wait 5
========================Exec、Run详解===============================
方法声明:
Function Exec(ByVal Command As String) As WshExec
Function Run(ByVal Command As String, [ByVal WindowStyle], [ByVal WaitOnReturn]) As Integer
区别: