Dim oShell, oExec, sLine Set oShell = CreateObject("WScript.Shell") Dim acmd :acmd="%COMSPEC% /c " Dim a :a="dir" Dim b :b=" c:" Dim strp :strp=a&b&"\" Set oExec = oShell.Exec(acmd&strp) 'Set oExec = oShell.Exec("%COMSPEC%/c cacls D:\") Set oSTDOUT=oExec.StdOut str_out=oSTDOUT.Readline wscript.echo str_out
'Do While oExec.Status = 1 ' WScript.Sleep 50 'Loop 'Do Until oExec.StdOut.AtEndOfStream ' sLine = oExec.StdOut.ReadLine ' If InStr(LCase(sLine), "domain admins") > 0 Then ' WScript.Echo "Admins be heer,Arr!" 'Else 'WScript.Echo "No Admins