Hah, GOTO is bad

No, seriously, you can prevent these GOTOs quite easily to make your script easier to understand for yourself and others.

For example this :

Code:

If NOT something()
goto "next"
EndIf

code for something=true
.
.
.
.
.
.
.
.
.
:next



is more readable(due to indentation) like this:

Code:

If NOT something()
code for something=true
.
.
.
.
.
.
.
Endif



This is also unneccessary :
Code:

If @PRODUCTSUITE = "Terminal Server" ;Skipping Servers
goto "exit"
EndIf



better:
Code:

If @PRODUCTSUITE = "Terminal Server"
exit 0
EndIf



Note the exit code, this is to prevent EXIT to return rubbish to calling scripts, maybe causing expression errors, as EXIT does return the following code anytime!

Code:

OPEN ( ....
WRITELINE ( ....
Close(...


No big deal in this case as you hide the console, but unsilenced function calls will display the return codes in the console, so consider the habit of assigning function calls to dummy variables.


Code:

ELSE
BEEP
? "failed to open file, error code : [" + @ERROR + "]"
ENDIF



err, your console is set to be hidden, so what's this for ?
_________________________