My Opera is closing 1st of March

M.I.T = Multimedia IT dept.

Subscribe to RSS feed

RUN Windows Media with VBscript and Perl: checkWMCmd.bat

, ,

@echo off
:: check if it's time to insert CF
SET INSERTORNOT=
for /f "tokens=1 usebackq" %%A in (`perl checktime.pl`) do (SET INSERTORNOT=%%A)
if "%INSERTORNOT%" == "INSERTNOW" goto INSERTNOW
if "%INSERTORNOT%" == "INSERTEND" goto INSERTEND
goto REGULARCHECK

:INSERTNOW
taskkill /f /im cscript.exe
cscript WMCmd.vbs -wme insert.wme
goto EXIT

:INSERTEND
taskkill /f /im cscript.exe

:REGULARCHECK
:: start checking whether cscript exists in tasklist!!
SET THETASK=
for /f "skip=2 tokens=1 usebackq" %%A in (`tasklist /fi "imagename eq cscript.exe"`) do (SET THETASK=%%A)
if not "%THETASK%" == "cscript.exe" goto DOWN
goto EXIT

:DOWN
:: print out down time to error log and restart cscript...
for /f "tokens=1-2 usebackq" %%A in (`date /T`) do (SET NOWDATE=%%A %%B)
for /f "tokens=1-2 usebackq" %%A in (`time /T`) do (SET NOWTIME=%%A %%B)
echo %NOWDATE% %NOWTIME% cscript.txt restarts...>> checktaskerr.txt
cscript WMCmd.vbs -wme default.wme

:EXIT
echo exiting...
February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28