简体   繁体   English

用户在预构建事件期间输入的文本

[英]User entered text during pre-build event

I am executing a batch file as a pre-build event.我正在执行批处理文件作为预构建事件。 The batch file however is expecting user input to continue (ie, "Type x to continue")然而,批处理文件期望用户输入继续(即“键入 x 继续”)

Is there a way to enter an 'x' followed by 'Enter' in the pre-build event so that the process continues.有没有办法在预构建事件中输入“x”后跟“Enter”,以便该过程继续进行。

Additionally, I have a second batch file that is run after the first.此外,我还有第二个批处理文件,它在第一个批处理文件之后运行。 Will the pre-build process wait for the first to complete or will it try to execute the second batch file immediately after calling the first?预构建过程会等待第一个完成还是会在调用第一个批处理文件后立即尝试执行第二个批处理文件? If so can I add a wait or pause to the pre-build?如果是这样,我可以在预构建中添加等待或暂停吗?

Use the call function with a new line and it will call the second batch file after the first batch file is called.使用带有新行的调用函数,它将在调用第一个批处理文件后调用第二个批处理文件。 How to: Specify Build Events如何:指定构建事件

 call C:\MyFile.bat
 call C:\MyFile2.bat

You can pipe in user input characters using the |您可以使用管道输入用户输入字符 | syntax句法

eg:例如:

x is sent to the batch file along with the enter key. x 与回车键一起发送到批处理文件。

 call echo x|C:\MyFile.bat 

Note: Pre-build events do not run if the project is up to date and no build is triggered注意:如果项目是最新的并且没有触发构建,则预构建事件不会运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM