jackylee0908 Posted January 4, 2019 Share Posted January 4, 2019 (edited) Hi sir and @VIP, I want to deliver VARs into Run() function as parameters for external batch script execution, for example on below code: $a = GUICtrlRead($N1BMCLANIP) $b = GUICtrlRead($N1BMCAC) $c = GUICtrlRead($N1BMCPW) $d = GUICtrlRead($NumberCycle) Run("a.bat $a $b $c $d", "") And for a.bat the code is: @echo off echo %1 echo %2 echo %3 echo %4 pause But the result I got is: $a $b $c $d Press any key to continue . . . So, I want to know how to deliver VARs for external tool uses? Thanks. Edited January 4, 2019 by jackylee0908 Link to comment Share on other sites More sharing options...
Subz Posted January 4, 2019 Share Posted January 4, 2019 Untested but maybe: Run("a.bat " & $a & " " & $b & " " & $c & " " & $d) Link to comment Share on other sites More sharing options...
jackylee0908 Posted January 4, 2019 Author Share Posted January 4, 2019 55 minutes ago, Subz said: Untested but maybe: Run("a.bat " & $a & " " & $b & " " & $c & " " & $d) That's work for me, thanks, @Subz. Link to comment Share on other sites More sharing options...
Subz Posted January 4, 2019 Share Posted January 4, 2019 NP: you can also use something like Opt("ExpandVarStrings", 1) $a = GUICtrlRead($N1BMCLANIP) $b = GUICtrlRead($N1BMCAC) $c = GUICtrlRead($N1BMCPW) $d = GUICtrlRead($NumberCycle) Run("a.bat $a$ $b$ $c$ $d$") Link to comment Share on other sites More sharing options...
jackylee0908 Posted January 4, 2019 Author Share Posted January 4, 2019 3 hours ago, Subz said: NP: you can also use something like Opt("ExpandVarStrings", 1) $a = GUICtrlRead($N1BMCLANIP) $b = GUICtrlRead($N1BMCAC) $c = GUICtrlRead($N1BMCPW) $d = GUICtrlRead($NumberCycle) Run("a.bat $a$ $b$ $c$ $d$") OK, it seems more better, thanks. 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