Jump to content

Recommended Posts

Posted

If I am using a RunWait command to launch a batch file from within an AutoIt script, how can I pass a variable to said batch file so that the batch file can utilize said variable like in a %var% format? Thank you in advance.

Posted

You can use the EnvSet function to create a variable that can be referenced from the batch file as long as the batch is spawned from the same script.

Crude example:

EnvSet("testvar","Oh Yeah!")
Run(@ComSpec & " /k echo %testvar%")

 

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
×
×
  • Create New...