|
Answer» Hi,
How can we 'Stop a service running on different machine or another SERVER using normal MS DOS Batch file code. If somebody have any code for the same, please send me.
set TargetService=Themes set ServiceHost=HDBLTERGHS0005 set PathToSC=c:\WINNT\system32 set PathToSleep=C:\Program Files\ResKit
set LOGFILE=restart.service.log
echo %DATE% %time% Entering sequence to restart %TargetService% >> LogFile% %PathToSC%\sc.exe \\%ServiceHost% stop %TargetService% echo %date% %time% Restarted %TargetService% >> %LogFile%
Thanks.... Sudheer have you tried the above code, and what does it say[SC] StartService: OpenService FAILED 5:
Access is denied.
I am getting the above ERROR, how can we set the permissions so that another user on different machine can access a service. Also both the users have the same admin privilege
|