The attached code is in a loop where everytime it runs, strcomputername is changed - thus shutting down multiple machines in a target list.
The problem I am having is that strcapture is always an empty carriage return when written out to the logfile. I know that if the machine shutdown is successful then the empty blank line returned is expected, but when i run the command against a machine name that doesn't exist, it should come back with an error like "The Network Path Was Not Found" or similar.
How can i get strCapture to capture the output correctly?
strCommand = "shutdown -s -m \\" & strcomputername & " -t 00 -f"
Set objScriptExec = objShell.Exec(strCommand)
strCapture = objScriptExec.StdOut.ReadAll