China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 02:19
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Use the At command to schedule a shutdown! View 2,132 Replies 8
Original Poster Posted 2008-06-03 13:23 ·  中国 江西 九江 电信
初级用户
Credits 51
Posts 25
Joined 2008-04-27 10:13
18-year member
UID 117080
Gender Male
From 学校
Status Offline
We can use AT commands to shut down at a specified date and time!
For example: 1. To shut down at 22:00 every day, you can use the following command (it has been passed in XP's cmd)
at 22:00 /every:m,t,w,tu,f,s,su shutdown -s -t 20
2. To shut down at 8:00 on Monday every week
at 8:00 /every:m shutdown -s -t 20
(The number after -t can be customized, and the -c "" parameter can also be used. Enter the prompt in "")
Floor 2 Posted 2008-06-03 20:32 ·  中国 广东 中移铁通
新手上路
Credits 2
Posts 1
Joined 2007-12-31 15:39
18-year member
UID 107326
Gender Male
Status Offline
Excuse me, how to cancel?
Floor 3 Posted 2008-06-20 19:53 ·  中国 湖北 武汉 联通
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Originally posted by hacker56 at 2008-6-3 20:32:
How to cancel?

shutdown -a
Floor 4 Posted 2008-06-21 19:42 ·  中国 山东 济宁 兖州区 联通
钻石会员
★★★★★
Credits 10,054
Posts 3,041
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
What you said upstairs is wrong.
简单就是美
Floor 5 Posted 2008-06-22 18:01 ·  中国 四川 成都 电信
新手上路
Credits 17
Posts 9
Joined 2008-06-21 00:54
18-year member
UID 120664
Gender Male
Status Offline
A very useful little trick!
Floor 6 Posted 2008-06-22 23:26 ·  中国 安徽 合肥 巢湖市 电信
初级用户
Credits 23
Posts 14
Joined 2007-05-16 23:36
19-year member
UID 88761
Gender Female
Status Offline
I'll give it a try, thanks.
Floor 7 Posted 2008-06-23 10:53 ·  中国 湖南 长沙 电信
初级用户
★★
Credits 187
Posts 87
Joined 2007-10-23 16:04
18-year member
UID 100558
Gender Male
Status Offline
Originally posted by hacker56 at 2008-6-3 08:32 PM:
How to cancel?



sc config schedule start= demand&&sc stop schedule
Floor 8 Posted 2008-06-25 14:04 ·  中国 黑龙江 大庆 大庆中基石油通信建设有限公司
高级用户
★★
Credits 547
Posts 261
Joined 2006-04-15 16:50
20-year member
UID 53887
Status Offline
Originally posted by liminghack at 2008-6-3 13:23:
We can use AT commands to implement shutting down at a specified date and time!
For example: 1. To shut down at 22:00 every day, you can use the following command (verified in XP's cmd)
at 22:00 /every:m,t,w,tu,f,s,su sh ...

I set it up the same way, but why doesn't it work?
How to check if the AT scheduled task is executed? Whether it is executed correctly?
Floor 9 Posted 2008-06-29 12:30 ·  中国 广东 梅州 五华县 电信
初级用户
Credits 79
Posts 34
Joined 2008-04-02 23:20
18-year member
UID 114802
Gender Male
Status Offline
Quote:
Originally posted by hacker56 at 2008-6-3 20:32:
How to cancel it?


You can close the service as regvip2008 said, but you can't load tasks before the service is enabled.

Another method is to delete the task.
Open Start - Control Panel - Task Scheduler, see the customized task, delete it!
I wrote a principle bat before, now send the code for everyone to see (originally wanted to say "research" but thought it had no technology so changed it )

Code:
@mode con cols=90 lines=35&color 1f
@echo off
call :cl
goto input
:1
title Scheduled Shutdown! made by: Xiaoye
cls
echo Current time: %date% , %time%
echo\&echo Please enter the scheduled shutdown time. (Need 24-hour format, such as 17:30 : Please use English punctuation)&echo\&echo\
echo If you want to return to the menu function, press 0 and enter!
echo.
set tim=
set /p tim=Please enter the shutdown time:
if "\%tim%\"=="\0\" call :cl&goto input
at %tim% /interactive shutdown -s -c "To cancel the shutdown, please select the cancel shutdown function in the function menu!!" >nul
if errorlevel 1 cls&echo * Incorrect input, please re-enter! &goto 1
echo.
echo.
echo.
echo.
echo ================Setting successful!!!==============================
echo.
echo ======Remember to save documents or other things that need to be saved before shutdown! ^_^=====
ping -n 2 127.1>nul
call :cl
goto input
:2
shutdown -a
cls
echo.
echo.
echo.
title Shutdown canceled successfully! made by: Xiaoye
echo.
echo=======================Shutdown canceled successfully!!!==================
echo.
echo.
echo.
ping -n 2 127.1>nul
goto input
:4
cls
title Function Description made by: Xiaoye
echo.
echo.&echo.&echo.&echo.&echo.&echo.
echo ※※※※※※※※※※※※※※※※Function Description:※※※※※※※※※※※※※※※※※※※※※※
echo.
echo.
echo ◇◇◇◇Scheduled Shutdown: The scheduled shutdown function can only be used on the same day. It can enter multiple shutdown times in the same time period. The system will automatically start the shutdown times in chronological order (that is, after the first shutdown time is canceled, the second shutdown time will be automatically started, and so on!). After setting the shutdown time, you can view the set shutdown time under the "The shutdown time you set is:" in the function menu.
echo.
echo ◇◇◇◇Cancel Shutdown: Canceling the shutdown is only effective when the shutdown countdown window is popped up!! Using it before the window is popped up will display that the shutdown is canceled successfully, but the scheduled shutdown function is not actually canceled, and the scheduled shutdown function will still be started when the time comes! !
echo.
echo ◇◇◇◇Exit: Exit the program window!!
echo.
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo\&echo.&echo.
pause
goto input

:3
cls&exit
:input
cls
title Function Code Number Selection!
cls
call :card
echo\&echo\&echo\
echo Please enter the function code number:
echo.
set sel=
set /p sel=
if "\%sel%\"=="" goto input
call :%sel%
if errorlevel 1 cls&echo\&echo\&echo\&echo\&echo ========= ☆★Incorrect command entered, trying to fool me? !★☆======&call :cl&goto input
:cl
for /l %%i in (1,1,40) do (
echo\
for /l %%a in (1,1,250) do ver>nul
)
goto :eof
:card
title Function Menu! made by: Xiaoye
echo\&echo\&echo.
echo\&echo\&echo Function Menu:
echo ▲△△△△△△△△△△△△△△△△△△
echo ▲ ▲
echo ▲ 1=Scheduled Shutdown ▲
echo ▲ ▲
echo ▲ 2=Cancel Shutdown ▲
echo ▲ ▲
echo ▲ 3=Exit ▲
echo ▲ ▲
echo ▲ 4=Function Description ▲
echo ▲ ▲
echo △△△△△△△△△△△△△△△△△△▲
echo.
echo.
echo.
echo (Note: The code number on the left of the equal sign is the function code number, please enter the code number on the left!&echo\
echo The cancel shutdown function is only effective when the shutdown countdown window is popped up!!)
echo.
echo.
echo.
echo The shutdown time you set is: %tim%
Forum Jump: