@ECHO OFF REM REM Windows command line batch script to remove the scheduled shutdown again. REM SETLOCAL REM Prepare the shutdown command line. REM Copy the following three lines from the installation script when changed. SET MyComment=This is my comment. SET OurShutdown=SHUTDOWN -r -t 180 -d up:241:50000 -c "%MyComment%" SET OurValue=P;241;50000 REM Remove the double quotation marks for the comparisons. SET OurShutdown=%OurShutdown:"=% AT>"%TEMP%\TheAtOutput.dat" REM Find the lines in the AT output that contain OurShutdown FOR /F "eol=; tokens=* delims=," %%a IN ('TYPE "%TEMP%\TheAtOutput.dat"^|FINDSTR "%OurShutdown%"') DO CALL :Analyse %%a REM Remove the reason text from the registry. REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\UserDefined /v "%OurValue%" /f GOTO :KeyEnd :Analyse REM Remove the quotation marks of the retrieved AT output lines. SET AtLine=%* SET AtLine=%AtLine:"=% REM Take the first 4 characters and convert them into a number. SET AtID=%AtLine:~0,4% SET /A AtID=%AtID% + 0 IF "%AtID%."=="0." GOTO :EOF SET AtID=%AtID: =% REM Remove the task from the scheduler. AT %AtID% /DELETE GOTO :EOF :KeyEnd REM Clean up. DEL /F/Q "%TEMP%\TheAtOutput.dat" ECHO. ECHO Finished. REM Check for some common 'Quiet' switches. IF /i "%1."=="/Q." GOTO :End IF /i "%1."=="/SILENT." GOTO :End ECHO Press any key to continue. PAUSE>NUL :End ENDLOCAL