Jump to content
Sign in to follow this  

Variables within executable parameters

Recommended Posts



i am trying to set up a script to run a program (aida32) using the program's command line parameters. the problem i have is the parameters include a path to a file which includes a variable, as below:

run(@ScriptDir&'\aida32.exe /r' @Scriptdir&'\PCName /custom '@ScriptDir&'\asset.rpf /csv /silent')

i have also tried:

ShellExecuteWait (@ScriptDir&'\aida32.exe /r',@ScriptDir&'\reports\PCName /custom '@ScriptDir&'\asset.rpf /csv /silent')

but i just keep getting an error:

run(@ScriptDir&'\aida32.exe /r c:\reports\PCName /custom '@ScriptDir&'\asset.rpf /csv /silent')

run(^ ERROR

if i run the script with 1 parameter, ie:

ShellExecuteWait (@ScriptDir&'\aida32.exe /r')

or with a fixed path replacing the second variable, ie:

ShellExecuteWait (@ScriptDir&'\aida32.exe /r','c:\reports\PCName')

it runs, no problem, but i can't use a fixed path as it will vary.......hence the variable :rolleyes:

can anyone help.......PLEEEEAAASSSEEE :rambo:



Edited by sxyrich

Share this post

Link to post
Share on other sites

What is the variable? the PCname is the var? Because you CAN use $variables in the Run() command

Edited by danwilli

Share this post

Link to post
Share on other sites

just a syntax error :rolleyes:


you have to use & to concat strings

Thank you very much Piccaso, that's done the trick. i've not used AutoIT since version 2, so am a little rusty....been using Autohotkey, but am now back in the fold :rambo:

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.