billym Posted September 1, 2005 Posted September 1, 2005 How do I get the command line parameters that I pass to my script/exe? ex... script.exe /file=c:\config.ini /display=silent
GaryFrost Posted September 1, 2005 Posted September 1, 2005 From the help fileCommand Line ParametersThe special array $CmdLine is initialized with the command line parameters passed in to your AutoIt script. Note the scriptname is not classed as a parameter; get this information with @ScriptName instead. A parameter that contains spaces must be surrounded by "double quotes". Compiled scripts accept command line parameters in the same way.$CmdLine[0]is number of parameters$CmdLine[1] is param 1 (after the script name)$CmdLine[2] is param 2 etc...$CmdLine[$CmdLine[0]] is one way to get the last parameter... So if your script is run like this: AutoIt3.exe myscript.au3 param1 "this is another param"$CmdLine[0] equals... 2$CmdLine[1] equals... param1$CmdLine[2] equals... this is another param@ScriptName equals... myscript.au3 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
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