superbosu Posted January 31, 2011 Posted January 31, 2011 (edited) Hi all! I have a problem with my script... How can I set the Exit code of my .exe? Select Case $An = $Bn Exit (0) Case $An < $Bn Exit (2) endselect I want that if $An = $Bn the .exe file return 0 and if $An < $Bn the .exe return 2 is there a way to do that? tnx a lot Edited January 31, 2011 by superbosu
enaiman Posted January 31, 2011 Posted January 31, 2011 That IS the way to set the exit code. return code [optional] Integer that sets the script's return code. This code can be used by Windows or the DOS variable %ERRORLEVEL%. The default is 0. Scripts normally set an errorlevel of 0 if the script executed properly; error levels 1 and above typically indicate that the script did not execute properly. Your script is missing the EndSelect statement; it won't run at all in the current form. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
superbosu Posted January 31, 2011 Author Posted January 31, 2011 tnx for the reply.. i modified the code. take a look upper. mhhh... is there a way to do the same thing like in DOS ? DOS command: Exit 2 autoit command: ???
enaiman Posted January 31, 2011 Posted January 31, 2011 I don't know what is unclear for you? The code you have is the working one. That is the way it is done. What is not working for you?? SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
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