【问题标题】:Run bat file, from bash, in a new window and wait for response在新窗口中从 bash 运行 bat 文件并等待响应
【发布时间】:2019-02-04 02:16:42
【问题描述】:

我想在一个新的窗口中运行一个新的 cmd,它运行一个 bat 文件,从一个 bash shell 内部。在我的 sh 中,我尝试了这个命令。

start /wait  "$(pwd)\Tools\mybat.bat"

我的 bat 运行成功,但我的 shell 不等待它完成。我想这是因为 /wait 适用于 start 而不是 bat 执行。有没有办法做到这一点?

【问题讨论】:

    标签: batch-file cmd git-bash


    【解决方案1】:

    路径可以转换为 bash 可以理解和执行的东西。

     cmd.exe /C start /W "" cmd.exe /C "$(cygpath -m $(pwd))/Tools/mybat.bat"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-15
      • 1970-01-01
      • 2014-08-23
      • 2019-05-27
      • 1970-01-01
      • 2012-03-12
      • 1970-01-01
      相关资源
      最近更新 更多