vba shell 返回值

 

sub Sample1()
    Dim WSH, wExec, sCmd As String, Result As String
    Set WSH = CreateObject("WScript.Shell")         ''(1)
              ''(2)
    Set wExec = WSH.Exec("xcopy /?")    ''(3)
    
    Result = wExec.StdOut.ReadAll                   ''(5)
    MsgBox Result
    Set wExec = Nothing
    Set WSH = Nothing
End Sub

http://club.excelhome.net/thread-185905-1-1.html 9楼

http://www.excelba.com/Art/Html/370.html

posted @ 2017-06-28 08:10  老小鱼  阅读(2114)  评论(1)    收藏  举报