Page 1 of 1

Passing parameters to a shell command

Posted: Sun Feb 22, 2009 10:38 am
by Andycal
I've created me a little Autoit script that runs like this:

goologin.exe username password

Works a treat from the command line, however I'm trying to run it from RunRev:

Code: Select all

on mouseUp
   put "start '' 'c:\launcher\goologin.exe username password'" into myShell
   replace "'" with quote in myShell
   get shell(myShell)
end mouseUp
But I get back an error saying "Windows cannot find 'c:\launcher\goologin.exe username password'. "

The path is correct so I'm guessing I'm using the shell command incorrectly?

Posted: Sun Feb 22, 2009 12:02 pm
by SparkOut
Top of the head thought : because you've wrapped the whole string 'c:\launcher\goologin.exe username password' in a single set of quotes, Windows is looking for that whole string as the application to launch.
If you put quotes at the end of goologin.exe and wrap each argument in another set of quotes, does that help?
If not, do that anyway, but then wrap the entire thing in an extra set of quotes and see if that helps.
I'd start with (something that resolves to)

start "" "c:\launcher\goologin.exe" "username" "password" and go from there.

Posted: Mon Feb 23, 2009 3:48 pm
by Andycal
That's the bunny, cheers!