How would I constuct this with only one if and endif?

---------------
If InGroup("All Students")
USE H: /delete /persistent
USE H: @HOMESHR
endif >>>>>>>>>> is this correct and would it work this way
If @ERROR
$=MessageBox("Cannot map home share, reason: ["+@ERROR+"] "+@SERROR, "Logon error",0+16+4096,30)
$=LogOff(1)
EndIf
--------------

cheers
admad1