Public Function ExecDosCmd( _
ByVal sCommand _
)
Dim oExeResult
Dim sStrOut
Set oExeResult = CreateObject("WScript.Shell").Exec("%ComSpec% /c " & sCommand)
Do While Not (oExeResult.StdOut.AtEndOfStream)
sStrOut = sStrOut & vbNewLine & oExeResult.StdOut.ReadLine
Loop
ExecDosCmd = sStrOut
Set oExeResult = Nothing
End Function