Jump to content

parameter


Recommended Posts

Hi All,

sorry that this may seems like a stupid question. I could not find the ans from the forum and help file.

If I would like to run a file from command prompt:

myautoitscript.exe "hello world"

inside the script is

msgbox(paramaeter1)

How do I do this.

Link to comment
Share on other sites

This should set you in the right direction:

If $CmdLine[0] <> 0 Then
MsgBox(0, "My MsgBox", $CmdLine[1])
Else
MsgBox(0, "My MsgBox", "No parameter was entered")
EndIf

I wrote a batch file with this in it (myscript.exe is the compiled code above):

myscript.exe "hello world"
Edited by abberration
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...