Sublime Posted June 15, 2006 Posted June 15, 2006 How do you add command line parameters to your compiled autoit executable. I have searched through the forums and could not find anything, I know its out thr sumwhere considering I have seen it done on quite a few scripts around here.
GaryFrost Posted June 15, 2006 Posted June 15, 2006 search for $CmdLine in the help SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
slightly_abnormal Posted June 15, 2006 Posted June 15, 2006 autoit -> using autoit -> command line parameters
Rotahn Posted June 15, 2006 Posted June 15, 2006 (edited) Hiya all, Firstly let me start by saying Autoit is flippin brilliant.. i came accross this app a while back and i thought it was good then but the added functions in v3..well..brilliant..keep up the good work. Any way i didnt want to create a new thread when one already exists on a similar line so.. My simple question is....if i have written a script and compiled it to .exe... if i then drag and drop an ini file ontop of it through explorer, is this passed to the script as a command line parameter. so lets say i drag and drop test.ini ontop of script.exe would $cmdline read a parameter as 'test.ini' ? Hope that makes sense..lol Anyway high all and thanks for any help. Rotahn Edited cos i can't seem to type Edited June 15, 2006 by Rotahn
Sublime Posted June 17, 2006 Author Posted June 17, 2006 ?? would this INI be random or would it be the same as always and to answer your question yes it would but unless you code autoit to deal with an ini and to read it and react it would have to be of similar guide lines regardless of what it is. If it would be the same ini each time just use hte FileInstall("") function but my impression of what you have said is that this is not the case. Also why would you want to parse an INI? unless it is to allow for expandability without having to recode and have the script adjust based on the settings specified in the ini. It would help more if you could explain on the purpose and give a "short" scenario to illaborate on what you are asking.
MHz Posted June 17, 2006 Posted June 17, 2006 Welcome Rotahn, so lets say i drag and drop test.ini ontop of script.exe would $cmdline read a parameter as 'test.ini' ? Nothing like proving it to yourself. Compile this code and drop your file on it and see the MsgBoxes display for the incoming Commandline parameters. MsgBox(0x40000, 'Value of $CMDLINERAW', $CMDLINERAW) If $CMDLINE[0] Then For $i = 1 To $CMDLINE[0] MsgBox(0x40000, 'Value of $CMDLINE[' & $i & ']', $CMDLINE[$i]) Next EndIf Exit You can also use Shift+F8 if you are using Scite4AutoIt3 to test Commandline parameters within the editor, without the need for compiling.
Rotahn Posted June 17, 2006 Posted June 17, 2006 (edited) Nothing like proving it to yourself. Compile this code and drop your file on it and see the MsgBoxes display for the incoming Commandline parameters.Yeah, Sorry about this post.. i added the code to see if it would work about 5 mins after posting..thought it would be harder than it was. Was just trying to bounce off someone as i just couldn't see the wood for the trees at the time.Thanks for the reply though..just goes to show no matter how stupid the question, people here are happy to help sublime..unique named ini files are created from another process else where, the contents of which will probably differ quite a bit. It is able to install 30 + apps on a machine unattended but from a list of apps that can change per user / machine. Rotahn Edited June 17, 2006 by Rotahn
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