Jump to content

How to return not only %errorlevel% to batch


Recommended Posts

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

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

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 script

Through registry or file, don want to save variables as plain text anywhere, login and password :)))))

Link to comment
Share on other sites

whatever Edited 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

whatever Edited 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

whatever Edited 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

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 :)...
Link to comment
Share on other sites

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

whatever Edited 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

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 by KaFu
Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...