VBS将Cmd命令结果赋值给变量。 function Runcmd(cmd) Dim strText Set oShell = CreateObject("WScript.Shell") Set oExec = oShell.exec("%COMSPEC% /C "&cmd) Do While Not oExec.StdOut.AtEndOfStream strText = oExec.StdOut.ReadAll() Loop Runcmd = strtext end function 1. 2. 3. 4. 5. 6...