【问题标题】:How can you create a command to run other applications in Windows Batch? [closed]如何创建命令以在 Windows Batch 中运行其他应用程序? [关闭]
【发布时间】:2020-05-24 16:04:06
【问题描述】:

我的目标是通过 Windows Batch 中的一个命令运行其他程序。 Here are the files I would like to run through a single command if possible.

但是我尝试过的代码最多是这样的

start "C:\users\excre\OneDrive\Desktop\Coding Files\GTA Chinatown\Terms & Conditions.html" 
start "C:\users\excre\OneDrive\Desktop\Coding Files\GTA Chinatown\Audio_Synthesis-Program.vbs"
start "C:\users\excre\OneDrive\Desktop\Coding Files\GTA Chinatown\test3.bat"

This resulted in a simple location CMD tab as shown here


如果有人对此有潜在的解决方案,请在下面提及

【问题讨论】:

  • 你想并行还是队列运行这些?
  • start 的第一个引用参数设置为标题(如您在屏幕截图中所见)。

标签: html batch-file vbscript


【解决方案1】:

如果您想使用队列在单个终端中运行命令,可以使用&&

command1.bat && command2.bat && command3.bat && test.html

如果您在此处的任何命令之前使用start,它将在新窗口中打开。

start "Mytitle" test.html  && command1.bat && command2.bat && command3.bat

更新:

start "Mytitle" "C:\users\excre\OneDrive\Desktop\Coding Files\GTA Chinatown\Terms & Conditions.html" &&
"C:\users\excre\OneDrive\Desktop\Coding Files\GTA Chinatown\Audio_Synthesis-Program.vbs"
&&
"C:\users\excre\OneDrive\Desktop\Coding Files\GTA Chinatown\test3.bat"

我想这就是你要找的。​​p>


如果你想保持打开你的主命令窗口,你可以将PAUSE 添加到队列中。
start "Mytitle" test.html && command1.bat && command2.bat && command3.bat && PAUSE

【讨论】:

  • 当我运行它时,它开始在新选项卡中打开文件但自动关闭?这是我的程序可能出现的错误吗?也谢谢你的回答。
  • start 认为它遇到的第一组引号是窗口的标题
  • @Streak 我不明白你在问什么,但如果你想保持打开窗口,请将PAUSE 添加到你的队列中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多