【发布时间】:2014-01-16 08:50:33
【问题描述】:
Windows 7 CMD.exe 样式批处理
我不确定这是否能完美运行。我觉得有时 TIMEOUT 完成并且蝙蝠自己执行 SHUTDOWN -ABORT。我希望用户只需按一个键即可停止关机倒计时(理想情况下,只需 COMMENT “OK”按钮就足够了),否则可以完美关闭计算机。
if exist "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" ("C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 vlc://quit) else goto end
shutdown -s -t 120 -c "Press any key in the Command Prompt to cancel the shutdown."
timeout -t 120
shutdown -a
我考虑添加 PING 999.999.999.999 -n 1 -w 1000 来强制短暂等待,但如果用户按下某个键,那么它会在中止关机之前等待,这也可能导致问题。
【问题讨论】:
-
将此
start "C:\Program Files\GlovePIE045Free\piefree.exe"更改为start "" "C:\Program Files\GlovePIE045Free\piefree.exe",因为第一个引用的术语用作窗口标题。然后将""用作空标题。 -
是的,我试过
start "" "C:\Program Files\GlovePIE045Free\piefree.exe" -"C:\Program Files\GlovePIE045Free\CustomScripts\xbox360VLCremote.PIE" /tray但它返回 [-"C:\Program is not a valid program] -
等等,我刚试了一下,它运行了两个程序(耶),但 VLC 没有制作播放列表,只运行用于拖动整个文件的文件。
-
piefree是做什么的? -
我发现它是一种使用我的无线控制器来命令 VLC 的方法。 (code.google.com/p/xbox-360-vlc-remote)
标签: batch-file countdown shutdown