Passing parameters to a shell command

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Passing parameters to a shell command

Post by Andycal » Sun Feb 22, 2009 10:38 am

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?

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Sun Feb 22, 2009 12:02 pm

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.

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Post by Andycal » Mon Feb 23, 2009 3:48 pm

That's the bunny, cheers!

Post Reply