我看到有一些与我的问题有关的主题,但是有些东西缺失,我需要创建一个重启计算机并发送流行音乐的批处理;我有这个:
@echo off
cd c:\windows\system32
shutdown -r -t 600 -c "Your machine you need to reboot in 5 minutes." -f
exit
但是我需要更多东西,我需要在计算机重新启动前2分钟提醒一下,并且有一种方法可以让用户在计算机重启之前停止或提出新的时间。
答案 0 :(得分:2)
@echo off
shutdown -r -t 300 -c "Your machine you need to reboot in 5 minutes."
Echo Press any key to cancel
timeout /t 180
Echo 2 mins to go
timeout /t 9999
shutdown /a
获得一般帮助。在命令提示符下键入Help
。对于列出的每个命令,请键入help <command>
(例如help dir
)或<command> /?
(例如dir /?
)。
答案 1 :(得分:1)
你可以尝试这样的事情:
@echo off
shutdown -r -t 600 -c "Your machine you need to reboot in 5 minutes." -f
Call :AskQuestion
exit
::***********************************************************************
:AskQuestion
(
echo Set Ws = CreateObject("wscript.shell"^)
echo wscript.sleep 180000
echo Answ = MsgBox("Did you want to cancel the scheduled reboot of your the computer ?"_
echo ,VbYesNo+VbQuestion,"Did you want to cancel the scheduled reboot of your the computer ?"^)
echo If Answ = VbYes then
echo Return = Ws.Run("cmd /c Shutdown -a",0,True^)
echo Else
echo wscript.Quit(1^)
echo End If
)>"%tmp%\%~n0.vbs"
Start "" "%tmp%\%~n0.vbs"