Jump to content

Recommended Posts

Posted

Hi All,

Is there a way in which I can pass a variable from a dos file to my AutoIT script?

I'm think of something like this:

SET /p Var1= [Enter IP Address]

<Do some stuff in batch file>

Start /W AutoIT.Script.exe %var1%

How can I get the script to recognize in %var1% in the script.

Any help is great help.

Regards

VJ

  • Moderators
Posted

Why not just convert the batch and run it from within autoit itself?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

  Quote

How can I get the script to recognize in %var1% in the script.

Something like that (see in help file $CmdLine params):

If $CmdLine[0] <> 0 Then MsgBox(0, "Passed param", "The param is: " & $CmdLine[1])

But if the %var1% will include spaces, then it will be splited to many parametrs, so in that case better use $CmdLineRaw - this contains the entire command line (see in help file) - or just pass the %var1% with dowble quotes.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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
  • Recently Browsing   0 members

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