Folder: \ TaskName Next Run Time Status ======================================== ====================== =============== notepad 7/11/2022 9:00:00 AM Ready
C:\Users\Leilei>SCHTASKS /Delete /TN NotePad WARNING: Are you sure you want to remove the task "NotePad" (Y/N)? y SUCCESS: The scheduled task "NotePad" was successfully deleted.
REM **************************************************************** REM REM Script Name: Task_Sch.bat REM Author: Leilei Shi REM Date: July 9th, 2022 REM REM Description: This script demonstrate how to schedule scripts using REM WSindows scheduler service and the Schtasks command. REM
REM **************************************************************** REM ******** Script Initialization Section **** REM Abort execution if OS is not Windows NT IF NOT "%os%" == "Windows_NT" ( ECHO. ECHO. ECHO Unsupported Operating system ECHO. ECHO. GOTO :EOF )
REM Define a variable that specifies the location of this script log file. SET ReportFile=C:\SchtasksReport.txt
REM ******** Main Processing Section **** REM Call a procedure that logs this script's execution. CALL :SetUpSchedLog
REM Call the procedure that sets up scheduled tasks. CALL :SetUpSchedule
GOTO :EOF
REM ******** Procedure Section **** REM This procedure writes a date and time entry to a report file :SetUpSchedLog
ECHO %date% %time% Task_Sch.bat - Now executing. > %ReportFile%
GOTO :EOF
REM This procedure sets up the scheduled execution of other programs/scripts using the schtasks command. :SetUpSchedule