So I would have variables for the USE command also....
here is the drive mapping code.
code:
$script = @curdir + "kixwin.kix"
Goto Logon_script ;do not remove these 2 lines!
;----------------------------------------------------------------------------[drives]
status = on
;set the TDNUm to equal the total number of drive mappings
TDnum = 3
;The drive mapping entires should eb in this format.
;OS type (All,9X,NT) | (G,L)Group G=global L=local | UNC for resource | Drive
;mapping1 = all|GDoamin Admins|\\server1\admins|w:
mapping1 = all|GDomain users|\\server\@userid$$|i:
mapping2 = 9x|GDomain users|\\server\share|j:
mapping3 = nt|L\\@wksta\administrators|\\server\share$$|k:
----------------------------------------------------------------------------
Do not edit below this line.
----------------------------------------------------------------------------
:Logon_script cls
gosub Load_Variables
if readprofilestring($script,"Drives","status") = on
Gosub Drives
endif
exit
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
:Load_Variables ;This is where all Global variables are set
$cr = chr(13)+chr(10) $lf = chr(10)
$notice = "" $welcome = ""
$DNum = 1 $code = ""
return
;----------------------------------------------------------------------------
:Drives
$TDNum = val(readprofilestring($script,"drives","TDnum"))
do
$rawdata = readprofilestring($script,"Drives","mapping$dnum")
$OSMap = substr($rawdata,1,instr($rawdata,"|")-1)
$rawdata = substr($rawdata,instr($rawdata,"|")+1,len($rawdata))
$GlobalLocal = substr($rawdata,1,1)
$Group = substr($rawdata,2,instr($rawdata,"|")-2)
$rawdata = substr($rawdata,instr($rawdata,"|")+1,len($rawdata))
$UNC = substr($rawdata,1,instr($rawdata,"|")-1)
$drive = substr($rawdata,instr($rawdata,"|")+1,len($rawdata))
select
case @inwin = 1 and $osmap = "nt"
select
case ingroup($group) = 2 $localGlobal = "L"
$code = 'use $drive "$unc"'
case ingroup($group) = 1 $localGlobal = "g"
$code = 'use $drive "$unc"'
case 1
? "can't find $group"
endselect
case @inwin = 2 and $osmap = "9x"
select
case ingroup($group) = 2 $localGlobal = "L"
$code = 'use $drive "$unc"'
case ingroup($group) = 1 $localGlobal = "g"
$code = 'use $drive "$unc"'
case 1
? "can't find $group"
endselect
case $osmap = "all"
select
case ingroup($group) = 2 $localGlobal = "L"
$code = 'use $drive "$unc"'
case ingroup($group) = 1 $localGlobal = "g"
$code = 'use $drive "$unc"'
case 1
? "can't find $group"
endselect
endselect
if $code <> "" $nul = execute($code) endif
$code = ""
$dnum = $dnum + 1
until $Dnum = $TDNum + 1
return