The Exit statement in vbscript allows you to exit a block of code, in the case of a subroutine (Exit Sub) or a function (Exit Function), or the entire script.
This statement is assumed at the end of a script, and therefore is not required, but is typically used in conditional statements to exit a section of code when a particular condition is met.
Below is an example:
testvar=testvar + 1
if testvar =2 then