Sign in to follow this  
Followers 0
Rico.JohnnY

How to retrieve the parameter from a autoit exe?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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}>

Take a look at $CmdLine array in Online documentation

Share this post


Link to post
Share on other sites

thx in advance for your reply...i get to try it now

Share this post


Link to post
Share on other sites

also good idea to name it to a different file names, to call autoit.exe with autoit.exe can cause some bad mojo.

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  
Followers 0