- Jun 5, 2000
- 36,410
- 616
- 126
i have a app that monitors a log file and if the log file hasn't been updated in X minutes it will fire this bat file that will restart the service. I need to edit this bat file to also shutdown a application before the service. how can i do that?
c:\netsvc.exe servicename \\servername /stop
echo Pausing 15 seconds
sleep 15
c:\netsvc.exe servicename \\servername /start
echo Pausing 15 seconds
sleep 15
taskkill /s [PCNAME] /u [USER] /p [password] /IM [something.exe] /f
I added the bolded syntax to my bat file.
c:\netsvc.exe servicename \\servername /stop
echo Pausing 15 seconds
sleep 15
c:\netsvc.exe servicename \\servername /start
echo Pausing 15 seconds
sleep 15
taskkill /s [PCNAME] /u [USER] /p [password] /IM [something.exe] /f
I added the bolded syntax to my bat file.