Jump to content

Recommended Posts

Posted

Here is my simple hello.bat file

echo "hello"
pause
set I
pause
set IAMvalue="hello"
pause
set I
pause
exit 1

and my even simpler autoit3 script

EnvSet("IAMvalue","first")
$res=RunWait("HELLO.bat")
If $res=1 Then MsgBox(0,"", EnvGet("IAMvalue"))

The value "first" appears in the batch script which changes it to "hello"

but the msgbox displays the value "first", so the changed value does not survive the exit from the batch script.

Is there a way to pass a value from AutoIT3 to a batch script, and return a changed value ?

Posted

To my small extent of knowledge this isnt possible using strictly variables. Maybe the STDRead/Write commands may help.

Also piping the output to a file and then working from there may be useful.

One other thing I feel would be useful to point out is that AutoIt should be able to perform any operation you are having performed by a .bat script.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

  • 2 weeks later...
Posted

To my small extent of knowledge this isnt possible using strictly variables. Maybe the STDRead/Write commands may help.

Also piping the output to a file and then working from there may be useful.

One other thing I feel would be useful to point out is that AutoIt should be able to perform any operation you are having performed by a .bat script.

JS

Thanks for the info. :o

I was calling someone else's .bat script but found it easier to rewrite in AutoIT3 than try to get the variable passing to work B)

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