如何跳过在批处理文件中暂停 [英] How to skip pause in batch file

查看:1316
本文介绍了如何跳过在批处理文件中暂停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows批处理文件中,如果myScript.bat运行otherScript.bat,并在otherScript.bat,有一个在第一行暂停。我如何发送击键跳过myScript.bat的暂停?所以,我的脚本将不需要采取任何按键提取并不会被暂停阻塞。谢谢你。

In windows batch file, if myScript.bat runs otherScript.bat, and in otherScript.bat, there's a pause in first line. How can I send a keystroke to skip that pause in myScript.bat? So my script won't need to take any extract keystroke and won't be blocked by the pause. Thanks.

推荐答案

的一种方法是使用回声命令来执行击键你。

One way would be to use the echo command to do the keystroke for you.

例如:

@echo OFF

@echo Calling otherScript.bat...
@echo | call otherScript.bat
@echo Done.

otherScript.bat

pause
@echo Hello World

Stefan的解决方案更加灵活,允许您控制何时暂停或没有,但如果你不能够修改otherScript.bat由于某种原因,这个解决方案会奏效。

Stefan's solution is more flexible and allows you to control when to pause or not, but this solution will work if you're not able to revise otherScript.bat for some reason.

这篇关于如何跳过在批处理文件中暂停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆