I am calling the following commands from machine A to machine B.
<Exec Command="net.exe use \\B /delete" IgnoreExitCode="true"></Exec>
<Exec Command="net.exe use \\B /user:B\<username> <password>" IgnoreExitCode="true"></Exec>
<Exec Command="sc.exe \\B stop <service name>" IgnoreExitCode="true" />
The first two commands work fine, but the last one results in an Access Denied erorr.
Does anyone know what I am doing wrong?
Thanks,
Sachin
Looks like the account under which you are running the script does not have the required privileges to stop services. See Services permissions