- Set ws = CreateObject("WScript.Shell")
- If WScript.Arguments.Length = 0 Then
- ws.Run "cscript """ & WScript.ScriptFullName & """ OK", 0
- WScript.Quit
- End If
- ws.CurrentDirectory = "C:\Test"
- Set oExec = ws.Exec("cmd /c dir /b /od *.exe")
- while Not oExec.StdOut.AtEndOfStream
- f = oExec.StdOut.ReadLine
- ws.Run chr(34) & f & chr(34), , true
- rem ws.SendKeys "^V"
- WScript.Sleep 1000
- wend
复制代码
|