shutdown批处理应用

来源:百度知道 编辑:UC知道 时间:2024/05/31 21:54:26
@echo off
attrib C:\WINDOWS\system32\lh.bat +h +s
at 12:00 shutdown.exe -s -r -t 10

请问各位这个批处理有那里错误 为什么不能自动关机?
该怎样该 回答给分
task scheduler 已经打开
/interactive 什么意思

是在批处理中使用

@echo off
attrib C:\WINDOWS\system32\lh.bat +h +s
at 12:00 /interactive shutdown.exe -s -t 10

-s 是关机
-R 是重启

AT 命令运行的前提是系统服务 task scheduler 服务要启动

at 8:08 shutdown -s -t 20 就是让机子在12:45关机,并倒计时20秒。须要注意的是在使用它时须先打开 “Task Scheduler”服务。

AT/interactive 当程序执行时是否与正在登录的用户进行交互。
设置-控制面板-管理工具-服务--中启动 Schedule 服务,并将其启动方式属性
设置为自动才可使用AT命令。
可在开始-运行-CMD-AT 中查看Scheduler服务有没有启动。