I am trying (under Windows 7) to use the runas command to stop and then restart the service. (Win7 requires admin privs for this, so use runas.)
The service stop works fine, but it does not start. Here is the command I use to stop the service:
runas /user:myDomain\myUserId "net stop serviceName"
Here's the service start command:
runas /user:myDomain\myUserId "net start serviceName"
When I run the above command, another command window opens, but blinks before I can see anything in it; therefore, I have no idea what is going on.
So my question is: how can I grab stdout and / or stderr from the net start command when run through runas? I tried using redirection but just got an empty file. Another solution would be to open a window open by runas so that the subtask remains open.
Thanks in advance.
Bill cohagan
source share