This is the portion of my code
I have two File servers (FS1 and FS2)
Basically what script will do is check for a group that has a prefix of "_" and then assign the first group membership to letter S: then if user is a member of another group I then J.
What I want to do is if a user is a member of a group called _PTK it will map it to letter N: which is then pointing to my third File server called FS3.
Any idea how the code will looks like.
Cannot make it to work
Code:
$x="$$"
$v="\\FS1.xyz.org\"
; add
$w="\\FS2.xyz.org\"
; call the users drive
$u=@userid
$dir=$v+$u+$x
:COMMENT
$s = instr(@COMMENT,"(")
$e = instr(@COMMENT,")")
$l = ($e - $s) - 1
IF $s = 0
$g = "NONE"
ELSE
IF $e > 0
$g = SUBSTR(@COMMENT,$s+1,$l)
ELSE
$g = "NONE"
ENDIF
ENDIF
$grp=$w+$g+$x
:HOME
; REM NET USE HOME DIRECTORY
USE F: $dir
:SETGROUP
SET "GROUP=$g"
DIM $Group[20]
$i=0
$j=0
do
if substr(ENUMGROUP($i),1,1) = "_"
$j=$j+1
$Group[$j] = substr ENUMGROUP ($i),2,Len (ENUMGROUP($i))-1)
? $i " " $j " " $Group[$j]
?
endif
$i=$i+1
UNTIL Len(ENUMGROUP($i)) = 0 OR $i=20
$grp0=$w+$Group[1]+$x
$grp1=$w+$Group[2]+$x
$grp2=$w+$Group[3]+$x
$grp3=$w+$Group[4]+$x
$grp4=$w+$Group[5]+$x
$grp5=$w+$Group[6]+$x
$global="GLOBAL"
$gl=$w+$global+$x
USE L: $gl
if $j > 0
USE S: $grp0
endif
if $j > 1
USE I: $grp1
endif
if $j > 2
USE J: $grp2
endif
if $j > 3
USE K: $grp3
endif