Jump to content

How to retrieve the parameter from a autoit exe?


Recommended Posts

  • Developers

i.e.

there is a exe file called autoit.exe

and i call it with "autoit.exe /s:abc" from the command prompt ..

so within the script...how can i get the /s:abc parameter for use?

any suggestion appreciated

<{POST_SNAPBACK}>

If you want to specify commandline parameters and work with them inside an autoit script then look for $CMDLINE in the helpfile

Command line parameters

The 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...

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...