I've just expanded this Idea to have it
show current time and schedule on remote pc
ask to DELETE schedule
ask to delete again
🙂and then ask to add a time for it to reboot. allowing for ENTER to skip.
I went the way of AT \\pcname instead of psexec.
ok..a bit messy but here's the idea...
**just added CHKDSK scheduling and removal
🙂{actionpath}SchedReboot.bat {computer}
@echo off
if %1.==. GOTO END
:CHKDSK1
ECHO.
set /p chkdsk1=Schedule C Chkdsk? [1= /F 2= /R 3=StopCheck enter=skip]
if {%chkdsk1%}=={1} psexec -d \\%1 -s cmd /c "echo y|chkdsk c: /f"
if {%chkdsk1%}=={2} psexec -d \\%1 -s cmd /c "echo y|chkdsk c: /f /r"
if {%chkdsk1%}=={3} psexec -d \\%1 -s chkntfs c: /x
:STARTOFDELETE
ECHO.
NET TIME \\%1
ECHO Current AT Schedule is
at \\%1
REM Clearing variables
set chkdsk1=
set delsched=
set idnum=
set delagain=
set sdtime=
ECHO.
set /p delsched=Do you wish to delete a schedule (n/y) [enter=skip]?
if {%delsched%}=={y} goto yesdel
if {%delsched%}=={n} goto nodel
if %delsched%.==. goto nodel
goto nodel
:yesdel
set /p idnum=Enter number only of ID to delete [# or SPACE for All]?
at \\%1 %idnum% /delete
set /p delagain=Do you wish to delete another (n/y) [enter=skip]?
if {%delagain%}=={y} goto STARTOFDELETE
if {%delagain%}=={n} goto noagaindel
:noagaindel
:nodel
ECHO.
set /p sdtime=Time on Target Computers Local Time (2:00am , 02:00) [enter=skip]?
if %sdtime%.==. GOTO BLANK
ECHO.
ECHO Time entered: %sdtime%
at \\%1 %sdtime% shutdown -r -t 60 -f
Echo Reboot setup at time select with 60 second delay.
ECHO.
ECHO Press any key to close this window...
pause>nul
GOTO END
:BLANK
:END