批处理命令中如何在执行下一条命令时等待5秒钟

批处理命令中如何在执行下一条命令时等待5秒钟比如命令:e:/1.exe 后面自动停顿5秒钟,然后再执行:e:/2.exe 最后完成后自动关闭批处理窗口!

ping 有个参数是用来超时的,可以用了延时指定时间代码如下
e:\1.exe
ping 127.0.0.1 -n 6 -w 1000

e:\2.exe

就是延时5秒了
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-08-16
DOS里有个“choice.com”就是用于延迟执行命令的,命令行参数你自己查下吧。
第2个回答  2020-08-27
method1: ping 命令是一秒执行一次, -n 代表的次数
C:\Users\Administrator> ping 127.0.0.1 -n 5 && echo hello world!
method2:
C:\Users\Administrator> timeout 5 >nul && echo hello world!
method3:
C:\Users\Administrator> choice /d y /t 5 >nul || echo hello world!
第3个回答  2013-08-16
e: /1.exeping /n 6 127.1e: /2.exe
相似回答