是否有转义字符(在字符串声明中使用双引号时)? [英] Is there an escaping character (when using double-quotes in string declarations)?
本文介绍了是否有转义字符(在字符串声明中使用双引号时)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我正在运行的代码:
This is the code I'm running:
RunWait("ComSpec & " /c Start 'D:\Program Files (x86)\Pidgin\pidgin.exe'")
我也尝试了不带半引号和带引号的内容,但随后出现语法错误.
I have also tried without semiquotes and with quotes but then I get syntax errors.
推荐答案
问题是您计算机上的文件路径中包含空格,并且需要在其两端加上双引号.
The problem is that the file path on your computer has spaces in it and needs double-quotations around it.
在命令提示符下使用双引号尝试"D:\ Program Files(x86)\ Pidgin \ pidgin.exe",并确保程序已启动.
Try "D:\Program Files (x86)\Pidgin\pidgin.exe" from the command prompt with the double-quotations and make sure the program starts.
一旦知道它可以工作,就可以像这样将其添加到您的AutoIt代码中(请注意,它被单引号引起来了.)
Once you know it works you can add it to your AutoIt code like so (notice that it is surrounded by single-quotations).
RunWait(@ComSpec & " /c " & '"D:\Program Files (x86)\Pidgin\pidgin.exe"')
这篇关于是否有转义字符(在字符串声明中使用双引号时)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文