Sign in to follow this  
Followers 0
nikink

Something buggy with Run and doublequotes?

8 posts in this topic

Hiya folks, I dunno if this is a bug or not, but

; This one doesn't work
RunWait(@ComSpec & ' /c "' & @ProgramFilesDir & '\company\sub dir\program.exe" -a "' & @ScriptDir & '\Activation.xml" -d proxy.url.comu >> "C:\info.txt"')

; This one works
RunWait(@ComSpec & ' /c C:\Progra~1\company\subdir~1\program.exe -a "' & @ScriptDir & '\Activation.xml" -d proxy.url.com >> "C:\info.txt"')

so, yeah. The first example in my script looks good, but never worked and after using /k instead of /c I saw it was failing to read the double-quotes. So I had to resort to method 2 and eliminate all spaces in the path so that quotes weren't necessary - then it worked. If I manually type the command line with the double-quotes, it works.

So, maybe this is a bug with 3.2.1.3?

Share this post


Link to post
Share on other sites



Hiya folks, I dunno if this is a bug or not, but

; This one doesn't work
RunWait(@ComSpec & ' /c "' & @ProgramFilesDir & '\company\sub dir\program.exe" -a "' & @ScriptDir & '\Activation.xml" -d proxy.url.comu >> "C:\info.txt"')

; This one works
RunWait(@ComSpec & ' /c C:\Progra~1\company\subdir~1\program.exe -a "' & @ScriptDir & '\Activation.xml" -d proxy.url.com >> "C:\info.txt"')

so, yeah. The first example in my script looks good, but never worked and after using /k instead of /c I saw it was failing to read the double-quotes. So I had to resort to method 2 and eliminate all spaces in the path so that quotes weren't necessary - then it worked. If I manually type the command line with the double-quotes, it works.

So, maybe this is a bug with 3.2.1.3?

that's not a bug in autoit. Run both of your commands in a DOS box and see what happens...

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

If I run:

"C:\Program Files\company\sub dir\program.exe" -a "' & @ScriptDir & '\Activation.xml" -d proxy.url.com >> "C:\info.txt"

from a dosbox, it works...

What am I missing?

Share this post


Link to post
Share on other sites

If I run:

"C:\Program Files\company\sub dir\program.exe" -a "' & @ScriptDir & '\Activation.xml" -d proxy.url.com >> "C:\info.txt"

from a dosbox, it works...

What am I missing?

see "help cmd" in a dos box. Search for /s and the way " is handled by cmd.exe if you give the option /c or /k.


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Ok... I'm reading that and getting quite lost. But I presume the important bit is where it says if there are more than exactly 2 "s on the cmdline, then things go wrong, and since mine has 6, I'm screwed...

So, is there a way around this? It seems inelegant to use the ~1 abbreviations...

Share this post


Link to post
Share on other sites

Ok... I'm reading that and getting quite lost. But I presume the important bit is where it says if there are more than exactly 2 "s on the cmdline, then things go wrong, and since mine has 6, I'm screwed...

So, is there a way around this? It seems inelegant to use the ~1 abbreviations...

yes, use " (double quotes) just for the executable and ' (single quotes) for the other parameters. That should work. Another option would be to use ShellExecute().


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Alas, neither of those solutions appear to work. Oh well, thanks for the advice and help anyway! :)

Share this post


Link to post
Share on other sites

It might be that your system will like to work with 8 chars folders.. (Got a old program which I have to use Progra~1 in top install or it fails...


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0