Jump to content
Sign in to follow this  
prmanningham

Complex arguments

Recommended Posts

prmanningham

Hi guys, I'm having some issue with arguments here.

I have this batch file that works fine and I would like to convert to autoit :

"\\server\setup.exe" /s /v"/qn ALLUSERS=1 LEI_SILENT=1 PIDKEY=XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX LEI_ACDID_EMAIL=my@email.com LEI_ACDID_PWD=Password SERVER=server PORT=6319"

Unfortunately, the quotes in the arguements seem to be causing problems :

$setup = "setup.exe"
Run( $setup & " /s /v"/qn ALLUSERS=1 LEI_SILENT=1 PIDKEY=XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX LEI_ACDID_EMAIL=my@email.com LEI_ACDID_PWD=Password SERVER=server PORT=6319"" )
ProcessWaitClose ( $setup )

Would you have any suggestion in how to handle quotes in this context?

Thanks in advance!

Share this post


Link to post
Share on other sites
JLogan3o13

I always use a single quote for outer, and double quotes inside. Helps distinguish things:

Run( $setup & '/s /v"/qn ALLUSERS=1 LEI_SILENT=1 PIDKEY=XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX LEI_ACDID_EMAIL=my@email.com LEI_ACDID_PWD=Password SERVER=server PORT=6319"' )
Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
prmanningham

awesome, thanks for the fast support!

Share this post


Link to post
Share on other sites
DicatoroftheUSA

I would also load each argument into a variable for easy manipulation.

eg

$sServer='server'
$iPort=6319
...SERVER='&$sServer&' PORT='&$iPort
Edited by DicatoroftheUSA

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  

×