win7 shutdown命令
注意:
windows cmd進入命令行界面時使用dos命令,dos命令對大小寫不敏感,所以隨意。
另外如果要寫bat批處理文件時,注釋命令用"::".
用法:
shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] [/m computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]
shutdown.exe ……也一樣。
/l 注銷。這不能與 /m 或 /d 選項一起使用。
/s 關(guān)閉計算機。
/r 關(guān)閉并重新啟動計算機。
/g 關(guān)閉并重新啟動計算機。系統(tǒng)重新啟動后,重新啟動所有注冊的應(yīng)用程序。
/a 中止系統(tǒng)關(guān)閉。這只能在超時期間使用。
/p 關(guān)閉本地計算機,沒有超時或警告。
/h 休眠本地計算機。
/t xxx 設(shè)置關(guān)閉前的超時為 xxx 秒。有效范圍是 0-315360000 (10 年),默認值為 30.
用法實例:
電腦要在24:00關(guān)機,cmd進入命令窗口,輸入"at 24:00 Shutdown -s",這樣,到了24點,電腦就會出現(xiàn)"系統(tǒng)關(guān)機"對話框,默認有30秒鐘的倒計時并提示你保存工作。
如果你想以倒計時的方式關(guān)機,可以輸入"Shutdown.exe -s -t 7200",這里表示120分鐘后自動關(guān)機,"7200"代表120分鐘。
如果想取消的話,可以在運行中輸入"shutdown -a".另外輸入"shutdown -i",則可以打開設(shè)置自動關(guān)機對話框,對自動關(guān)機進行設(shè)置。
實例: at 12:45 shutdown -s -t 20 就是讓機子在12:45關(guān)機,并倒計時20秒。須要注意的是在使用它時須先打開 "Task Scheduler"服務(wù)。
休眠的命令:
at 8:10 rundll32 powrprof.dll,SetSuspendState
自動休眠的可以在CMD中輸入以下命令:
powercfg -h off
如果要重新開啟自動休眠,則用
powercfg -h on