开发者

How to escape parameter in windows command line?

开发者 https://www.devze.com 2022-12-22 02:15 出处:网络
I need to run the following command from the command line in Windows 7: SumatraPDF.exe -inverse-search \"\\\"C:\\Prog开发者_StackOverflow社区ram Files\\eclipse\\inverse_search.bat\\\" \\\"%f\\\" %l\"

I need to run the following command from the command line in Windows 7:

SumatraPDF.exe -inverse-search "\"C:\Prog开发者_StackOverflow社区ram Files\eclipse\inverse_search.bat\" \"%f\" %l"

However I need to modify it a little, since my installation of Eclipse is located in here:

C:\Program Files (x86)\Eclipse (C++)

How do I escape this line correctly? Do I need to escape parenthesis and pluses too? Or is it just enough to escape double quotes?


SumatraPDF.exe -inverse-search "\"C:\Program Files (x86)\Eclipse (C++)\inverse_search.bat\" \"%f\" %l"


When in doubt, escape everything. I find that I don't need to escape (), %, or +, though.


I don't even think you need to escape the quotes; it should be enough to do:

SumatraPDF.exe -inverse-search ""C:\Program Files (x86)\Eclipse (C++)\inverse_search.bat" %f %l"
0

精彩评论

暂无评论...
验证码 换一张
取 消