Search code examples
autoit

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.


Solution

  • The problem is that the file path on your computer has spaces in it and needs double-quotations around it.

    Try "D:\Program Files (x86)\Pidgin\pidgin.exe" from the command prompt with the double-quotations and make sure the program starts.

    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"')