批处理延时方法

来源:互联网 发布:linux查看cpu核心数 编辑:程序博客网 时间:2024/05/29 19:54

有时批处理希望停顿一下,等待其他处理,或者用户选择,超时后继续默认处理。可以用以下方法:


net start "Windows Update"@Echo offEcho See above message if OK.Echo -------------------------------echo Delay 5 seconds and exit .....for /L %%i in (5,-1,1) do echo %%i seconds left to Exit && ping 127.0.0.0 -n 2 > nulEcho Exit.