zpslon Posted April 1, 2010 Share Posted April 1, 2010 Need to return two variables from autoit script to batch file, but I found only how to return errorlevel with Exit($var). And errorlevel is only numeric , I have symbols in variables. Is any method except Exit? Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 1, 2010 Share Posted April 1, 2010 Did you try EnvSet() to pass values to external variables in the shell environment? You could also pass data through a small text file, or via the registry. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 Use consolewrite() and compile as CUI? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
zpslon Posted April 1, 2010 Author Share Posted April 1, 2010 Did you try EnvSet() to pass values to external variables in the shell environment? You could also pass data through a small text file, or via the registry.EnvSet()works only for programs launched from scriptThrough registry or file, don want to save variables as plain text anywhere, login and password )))) Link to comment Share on other sites More sharing options...
MvGulik Posted April 1, 2010 Share Posted April 1, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
MvGulik Posted April 1, 2010 Share Posted April 1, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 ConsoleWrite("test" & @crlf) sleep(2000) ConsoleWrite("test2" & @crlf) Compile as CUI instead of GUI and run from cmd.exe... can't see why that info should not be available to the executing batch file. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
MvGulik Posted April 1, 2010 Share Posted April 1, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 I think you misread the initial message. Not really , but... I'm not that into batch file programming... and always assumed that console output can easily be redirected to a variable for further use... might be wrong there ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 1, 2010 Share Posted April 1, 2010 (edited) Changes to the shell environment of the calling batch file are lost when that shell closes. Tell me what you think is more secure about a return value than a local shell variable...? You want to know how to securely pass credentials to a batch file: Don't!Edit: The script inherits only a copy of the parent batch file's environment, so that was true but not helpful since the parent shell never sees the changes. Rats. Edited April 1, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
MvGulik Posted April 1, 2010 Share Posted April 1, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 (edited) Burp. I guess there is.Strike ... and... nice research, I love this sometimes really productive ping-pong game ... was watching "Edge of Darkness" in parallel ... Edited April 1, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
zpslon Posted April 2, 2010 Author Share Posted April 2, 2010 When I try to write to console like this, in batch I get not real login and password, but names of variables, ConsoleWrite('$login $passwd' & @CRLF) In batch output D:\!!!!!!\Steam\Test>echo.var1=$login var1=$login D:\!!!!!!\Steam\Test>echo.var2=$passwd var2=$passwd If I try like this ConsoleWrite($login & @CRLF) In batch output D:\!!!!!!\Steam\Test>echo.var1=$login var1=username D:\!!!!!!\Steam\Test>echo.var2=$passwd var2= But it works only for one variable How to make It work for two variables? Link to comment Share on other sites More sharing options...
KaFu Posted April 2, 2010 Share Posted April 2, 2010 Try ConsoleWrite($login & " " & $passwd & @CRLF) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
zpslon Posted April 2, 2010 Author Share Posted April 2, 2010 It works! Thank you! Link to comment Share on other sites More sharing options...
KaFu Posted April 2, 2010 Share Posted April 2, 2010 Glad to hear that ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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