Jump to content

Pass parameters to AutoIT program


Recommended Posts

Hi,

 

Please help me. I couldn't find any solution for passing parameters from Php to AutoIT. Below are the codes;

PHP

$parameter = 5;
shell_exec("db.exe $parameter");

 

How to pass the $parameter to AutoIT program? Please help me. I tried to use command line, but it seems like I couldn't solve the problem

Link to comment
Share on other sites

  • Moderators

@billy85 look at Command Line parameters in the help file or here: 

https://www.autoitscript.com/autoit3/docs/intro/running.htm#CommandLine

the integrated $CmdLine array allows you to define your parameters from the calling function in a different language.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

@billy85 I'm not sure what I can provide beyond what the help file shows you. Here is another example - compile this script to whatever you want, then call the script with the /h parameter.

If $CmdLine[0] > 0 Then
        Switch $CmdLine[1]
            Case "/?"
                MsgBox(0, "", "Help")
            Case "/s"
                MsgBox(0, "", "_s")
            Case "/u"
                MsgBox(0, "", "_u")
            Case "/x"
                MsgBox(0, "", "_x")
        EndSwitch
    Else
        MsgBox(0, "", "No Parameters passed")
    EndIf

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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