關於 shutdown 指令 - Windows

Table of Contents

最近有設定 n 分鐘自動關機的需求

google後找到了內建的 shutdown 指令

如 shutdown -s -t 3600

表示 1 小時候自動關機


請問要怎麼建立一個指令或 bat 檔案

執行後會詢問使用者幾分鐘後關機 (只要設定分鐘就好了)

確定後自動計算成秒,然後執行shutdown


感謝......

--

All Comments

Ula avatarUla2012-09-13
google "bat 參數"
Charlie avatarCharlie2012-09-17
set /p enter=請你輸入您欲設定的秒數:
Shutdown.exe -s -t %enter%
Eartha avatarEartha2012-09-19
沒看到要自動計算分鐘>秒
Elma avatarElma2012-09-21
中間加個 set /a enter=enter*60
Olga avatarOlga2012-09-22
感謝樓上!!!