ProcessStartInfo.Arguments接受带有双引号的多个参数

问题描述 投票:1回答:1
string CandlePath = "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin\\candle.exe";
string BundlePath = "C:\\Solution Directory\\Bundle.wxs";
string wixObjPathToSave = "C:\\Solution Directory\\Bundle.wxs";
ProcessStartInfo processStartInfo = new ProcessStartInfo("cmd.exe"); 
processStartInfo.WindowStyle = ProcessWindowStyle.Normal;
processStartInfo.Arguments ="/k \"" + candlePath + "\" " +BundlePath + " " +wixObjPathToSave;

[当我像上面那样传递参数时,进程正在接受参数,但是Candle.exe给出错误,因为我没有给bundlePath和wixobjPathToSave提供双引号,所以无法将'C:\ Solution'识别为内部或外部命令] >

processStartInfo.Arguments ="/k \"" + candlePath + "\" \"" +BundlePath + "\" \"" + wixObjPathToSave +"\"";

当我传递上面的参数时,该过程给出错误,即'C:\ Program'无法识别为内部或外部命令。

我做错了什么?

string CandlePath =“ C:\\ Program Files(x86)\\ WiX Toolset v3.11 \\ bin \\ candle.exe”;字符串BundlePath =“ C:\\ Solution Directory \\ Bundle.wxs”;字符串wixObjPathToSave =“ C:\\ Solution Directory \\ Bundle ....

c# process.start wix3.11
1个回答
0
投票

我知道了答案

© www.soinside.com 2019 - 2024. All rights reserved.