Rieq82 Posted September 12, 2016 Share Posted September 12, 2016 Hi guys, I've been toying with AutoIT for just a few days now and I've run into a bit of a brick wall. I'm working on trying to pass a variable from script1 to script2, currently it looks something like this: Script1: $variable = "Test" Run('AutoIt3.exe "scripts\script2.au3" $variable') Script2: MsgBox("0", "Test Box", $CmdLine[1]) Everything works, except when the message box for script 2 launches it comes up with $variable instead of Test. The variable is getting passed to the second script but it's not being evaluated before it's passed, it's sending the variable instead of the value. Is there a way to send the value of a variable instead of hardcoding the data to be passed between scripts? Link to comment Share on other sites More sharing options...
JohnOne Posted September 12, 2016 Share Posted September 12, 2016 Run('AutoIt3.exe "scripts\script2.au3"' & $variable) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
AdamUL Posted September 12, 2016 Share Posted September 12, 2016 Don't forget the space after script file name. Also, I would use the @AutoItExe macro as well. Run(@AutoItExe & ' "scripts\script2.au3" ' & $variable) Adam Link to comment Share on other sites More sharing options...
aiter Posted September 12, 2016 Share Posted September 12, 2016 There was the same question, not too ago. Search the forum. Anyway, one of the ways was to set your own environment variables then read them in the called script. Link to comment Share on other sites More sharing options...
argumentum Posted September 12, 2016 Share Posted September 12, 2016 2 hours ago, aiter said: one of the ways was to set your own environment variables https://www.autoitscript.com/forum/topic/151123-netflare-web-server-version-03/#comment-1283830 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now