Sign in to follow this  
Followers 0
SyntaxError

environment variables and quote marks and parameters

6 posts in this topic

I've been fighting with this for 6 hours now. I'm convinced it's not possible in AutoIt. I'm setting a variable whose value is dynamic and has a parameter. The $path variable is being used in several RegWrite lines. It works fine if I hardcode the path, but I'm making my apps portable, so I can't hardcode it.

I know this isn't correct, but you get the idea.

Dim $path = @ScriptDir & "\App\Quickpar.exe" "%1"

The output must look like this (with the quotes): "D:\Programs\Quickpar\App\Quickpar.exe" "%1"

I've tried looking for similar examples and have found none.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I've been fighting with this for 6 hours now. I'm convinced it's not possible in AutoIt. I'm setting a variable whose value is dynamic and has a parameter. The $path variable is being used in several RegWrite lines. It works fine if I hardcode the path, but I'm making my apps portable, so I can't hardcode it.

I know this isn't correct, but you get the idea.

Dim $path = @ScriptDir & "\App\Quickpar.exe" "%1"oÝ÷ Ù8^¢ëiºÙ®²Ùh¢IbëaÌ"¶az«¨µë*ºCÓÝ®+jk4÷d.É)j½=Ø
iÓݺ'$¥ªÞÅꮢڮ¢ÝjºHßÛÞ¶¸vZ()à~ìh¥j·±jjezƧv¯yú.Ùèïêº^jëh×6Dim $path = '"' & @ScriptDir & "\App\Quickpar.exe" & '"' & ' "%1"'
MsgBox(64, 'Info', $path)

Edit:

Sorry I didn't see you needed the quotes.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

most likely needs a space also

Dim $path = @ScriptDir & "\App\Quickpar.exe " & "%1"

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

See my edit... I'm blind this late at night.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I see no reason but to simply add single quotes around the code 1st posted. No need to breakup the string.

Dim $path = '"' & @ScriptDir & '\App\Quickpar.exe" "%1"'
MsgBox(64, 'Info', $path)

:D

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Dim $path = '"' & @ScriptDir & '\App\Quickpar.exe" "%1"'
I went with this and it works great. Thanks everyone. This place is so supportive, I'm impressed.

I was trying to use various combinations of quotes and & all over the place, and once again, the answer was so simple I couldn't see it.

Edited by SyntaxError

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