SyntaxError Posted June 27, 2006 Posted June 27, 2006 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.
Moderators SmOke_N Posted June 27, 2006 Moderators Posted June 27, 2006 (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 June 27, 2006 by SmOke_N 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.
Valuater Posted June 27, 2006 Posted June 27, 2006 (edited) most likely needs a space also Dim $path = @ScriptDir & "\App\Quickpar.exe " & "%1" 8) Edited June 27, 2006 by Valuater
Moderators SmOke_N Posted June 27, 2006 Moderators Posted June 27, 2006 See my edit... I'm blind this late at night. 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.
MHz Posted June 27, 2006 Posted June 27, 2006 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)
SyntaxError Posted June 27, 2006 Author Posted June 27, 2006 (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 June 27, 2006 by SyntaxError
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now