使用Powershell自动生成以PAUSE结尾的bat文件
我有一个无法更改的批处理文件,但我想使用 Powershell 2.0 实现自动化。它以 PAUSE
命令结束,该命令显示:
按任意键继续...
有没有办法从 powershell 脚本调用此批处理文件,但让它退出不需要用户按什么东西?
I have a batch file that I can't change, but I want to automate with Powershell 2.0. It ends with a PAUSE
command, which displays:
Press any key to continue...
Is there an way to call this batch file from a powershell script, but have it exit without needing a user to press something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将任何内容通过管道传输到
cmd
进程中:该进程将被
cmd
视为输入,这足以让pause
停止暂停。示例代码此处。
You can pipe anything into the
cmd
process:which will be treated as input by
cmd
and that's enough forpause
to stop pausing.Sample code here.