Jump to content

Recommended Posts

Posted (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 by superbosu
Posted

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

Posted

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

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
  • Recently Browsing   0 members

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