aryx Posted November 12, 2006 Share Posted November 12, 2006 (edited) Hi, I want to automate closing a window when I start a program, but I need have a dynamic command that has to change every time I start the application. Here is an examples: "C:\Program Files\myprogram\myprogram.exe" /directory "C:\temp" "t:\12112006.dat" So what I want to do is to start the script with paramenters and put them in the Run() command. For example: RUN("C:\Program Files\myprogram\myprogram.exe /directory C:\temp" "T:\" & %params% & ".dat") Is it possible to do something like that? Best Regards Edited November 12, 2006 by aryx Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 12, 2006 Moderators Share Posted November 12, 2006 Hi, I want to automate closing a window when I start a program, but I need have a dynamic command that has to change every time I start the application. Here is an examples: So what I want to do is to start the script with paramenters and put them in the Run() command. For example: RUN("C:\Program Files\myprogram\myprogram.exe /directory C:\temp" "T:\" & %params% & ".dat") Is it possible to do something like that? Best RegardsYes 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. Link to comment Share on other sites More sharing options...
Valuater Posted November 12, 2006 Share Posted November 12, 2006 $parameters = 12112006 RUN("C:\Program Files\myprogram\myprogram.exe /directory C:\temp" "T:\" & $parameters & ".dat") this will not work as wriiten... just the concept is correct see help for directory and quotes use 8) Link to comment Share on other sites More sharing options...
aryx Posted November 12, 2006 Author Share Posted November 12, 2006 $parameters = 12112006RUN("C:\Program Files\myprogram\myprogram.exe /directory C:\temp" "T:\" & $parameters & ".dat")this will not work as wriiten... just the concept is correctsee help for directory and quotes use8)Ok, thanks, but the values can't come from the script, it has to come from the initial command to run the script...So if I compile a script as myscript.exeI want to run it by entering myscript.exe 12112006 or myscript.exe /mystring:12112006and then the script will add this in the parameters variable.Is it possible? I've tried to look at the Function Run under Help, but I can't find any information on this situation. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 12, 2006 Moderators Share Posted November 12, 2006 You need spaces between each of your parameters. Something like this maybe:Run('"C:\Program Files\myprogram\myprogram.exe"' & " /directory C:\temp" & ' "T:\' & $parameters & '.dat"') 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. Link to comment Share on other sites More sharing options...
aryx Posted November 12, 2006 Author Share Posted November 12, 2006 I think I found the answer when I searched for param* $CmdLine[1] should equal the data that is passed at the command line. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 12, 2006 Moderators Share Posted November 12, 2006 I think I found the answer when I searched for param* $CmdLine[1] should equal the data that is passed at the command line.I was under the impression you wanted to send the params not retrieve them, but yes, we use $cmdline[n] to retrieve the parameters sent to our apps. 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. Link to comment Share on other sites More sharing options...
aryx Posted November 12, 2006 Author Share Posted November 12, 2006 Sorry if I didn't write it clearly enough But it looks like I got what I need, will test it out now :-) Thanks for your quick and helpful response! Link to comment Share on other sites More sharing options...
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