如何使用&QUOT在Windows中创建批处理文件;启动"与路径和命令空间 [英] How to create batch file in Windows using "start" with a path and command with spaces

查看:97
本文介绍了如何使用&QUOT在Windows中创建批处理文件;启动"与路径和命令空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个在Windows .cmd文件启动多个控制台应用程序的批处理文件。这可以通过使用启动命令来实现。

然而,该命令具有在它的路径。我还需要通过具有空间以及PARAMATERS。如何做到这一点?

例如。批处理文件

 启动C:\\路径用空格\\ APP.EXE参数1参数用空格


解决方案

其实,他的榜样将无法正常工作(虽然一开始我还以为它会,太)。基于该帮助启动命令,第一个参数是新创建的命令提示窗口的名称,并在第二和第三应的路径分别应用程序及其参数。如果添加另一个路径的应用程序之前,它应该工作(至少它为我做的)。使用这样的:

 启动C:\\路径用空格\\ APP.EXE参数1参数用空格

您可以切换到你想要的新的命令提示符的标题是什么第一个参数。如果它是创建一个Windows应用程序,然后在命令提示符下将不显示,而标题并不重要。

I need to create a batch file which starts multiple console applications in a Windows .cmd file. This can be done using the start command.

However, the command has a path in it. I also need to pass paramaters which have spaces as well. How to do this?

E.g. batch file

start "c:\path with spaces\app.exe" param1 "param with spaces"

解决方案

Actually, his example won't work (although at first I thought that it would, too). Based on the help for the Start command, the first parameter is the name of the newly created Command Prompt window, and the second and third should be the path to the application and its parameters, respectively. If you add another "" before path to the app, it should work (at least it did for me). Use something like this:

start "" "c:\path with spaces\app.exe" param1 "param with spaces"

You can change the first argument to be whatever you want the title of the new command prompt to be. If it's a Windows app that is created, then the command prompt won't be displayed, and the title won't matter.

这篇关于如何使用&QUOT在Windows中创建批处理文件;启动"与路径和命令空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆