Originally Posted By: apronk
Because as far as I can see from the scriplet he postet, the first return statement makes the script not process the next if-else statement, wich I think is needed to process.


I suspect that the return in the IF construct is actually to halt processing of the subroutine if it is a CTX (Citrix) login - in which case it is correct if a bit poorly structured.

A better (and clearer) flow would be:
 Code:
:CMKW
	;Setting variable for Shared/Public drive
	$K="\\server2\share3"
 
	If InGroup("Group2")
		Use K: $K
	EndIf
 
	If $CTX<>"1" AND InGroup("Group1")
		Use O: "\\server1\share1"
		Use X: "\\server1\share2"
	EndIf

Return


There are a number of variations that would work just as well.

 Quote:
Besides that I hate Return commands \:\)

No argument here, but simply removing it would mean that the script would not function correctly.