Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
'The tool is launched
Set oExec = WshShell.Exec("Whoami /all")
'We wait for the end of process
Do While oExec.Status = 0
WScript.Sleep 100
Loop
'We scan and display the command output flow
Do While oExec.StdOut.AtEndOfStream <> True
Wscript.Echo oExec.StdOut.ReadLine
Loop