【问题标题】:Run Program and wait for process to complete运行程序并等待进程完成
【发布时间】:2016-01-17 07:47:31
【问题描述】:

我有一个应该运行 WTVCnverter 的简单 BAT 脚本。我希望它通过 *.wtv 匹配所有文件并使用转换为 dvr-ms 的程序。在执行第二个或第三个文件之前,它应该等待 WTVConverter 退出后再继续。

 @echo off


 for %%f in (*.in) do (

      echo %%~nf
      C:\Windows\ehome\WTVConverter.exe "%%~nf.wtv""%%~nf.dvr-ms" /ShowUI | out-null

 )

【问题讨论】:

    标签: batch-file scripting


    【解决方案1】:

    在批处理文件中(尽管您的代码在键入时按原样工作)在命令前加上 cmd /c start "" /w 所以

    cmd /c start "" /w C:\Windows\ehome\WTVConverter.exe "%%~nf.wtv""%%~nf.dvr-ms" /ShowUI | out-null
    

    GUI 进程(即不是控制台)在批处理中等待,但在键入时不等待。见start /?

    管道也由 cmd.exe 实现。如果您的管道字符用于您的程序转义,则使用 ^

    您似乎在输入和输出文件名之间缺少空格。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-06
      • 2011-12-16
      • 2015-06-13
      • 2013-08-11
      • 1970-01-01
      相关资源
      最近更新 更多