2016年3月1日 星期二

task scheduler to restart a software service

net stop "Service B"
net stop "Service A"
timeout /T 10
net start "Service B"
timeout /T 10
net start "Service A"
It's not ideal, but it will do for t

@echo off
set logfile=D:\logs\myapp.log
echo starting app.exe at %date% %time% >> %logfile%
app.exe -options oas >> %logfile%
To pause the command processor for ten seconds, type:
timeout /t 10
To pause the command processor for 100 seconds and ignore any keystroke, type:
timeout /t 100 /nobreak
To pause the command processor indefinitely until a key is pressed, type:
timeout /t -1

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。