Created
January 18, 2017 16:51
-
-
Save thomo/e1d334765f26c41d580ad46734237b4b to your computer and use it in GitHub Desktop.
cscript mit watchdog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
cd "D:\Daten\Skripte\" | |
start /min cmd /c watchdog.cmd | |
c:\Windows\SysWOW64\cscript.exe "D:\Daten\Skripte\Sync.vbs" %* | |
del watchdog_starttimestamp.ts 2> nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
date /t > watchdog_starttimestamp.ts | |
time /t >> watchdog_starttimestamp.ts | |
set looptime=5 | |
set timeout=600 | |
REM --------------------------------------------------- | |
set count=0 | |
:loop | |
timeout /T %looptime% > nul | |
set /A count+=%looptime% | |
for /f %%i in ('taskkill /FI "STATUS eq NOT RESPONDING" /IM cscript.exe /F') do Set result=%%i | |
IF not x%result:SUCCESS=%==x%result% ( | |
echo "kill cscript" | |
goto ende | |
) | |
IF NOT EXIST "watchdog_starttimestamp.ts" ( | |
echo "finish watchdog" | |
goto ende | |
) | |
IF %count% GEQ %timeout% ( | |
echo "timeout" | |
goto ende | |
) | |
goto loop | |
:ende | |
del "watchdog_starttimestamp.ts" 2> nul | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment