code:
If @Homeshr<>""
Dim $x
$x=Substr($Homeshr,3,len($Homeshr)-2)
$Hserver=Substr($x,1,instr($x,"\")-1)
$UserShare=Substr($x,instr($x,"\")+1,len($x)-instr($x,"\"))
Endif
If $HomeDrive<>"" and $Hserver<>"" and $UserShare<>""
MapDrive($HomeDrive, $Hserver, $UserShare)else
Writelog("Home drive is either not defined or improperly defined for this user: Drive='" +
$HomeDrive + "', Server='" + $Hserver + "', Share='" + $UserShare + "'")
endif
Function MapDrive($Drive, $Server, $Share)
Dim $Drive, $Server, $Share
Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>""
$LogText="Connecting $Drive to \\$Server\$Share"
? $LogText
USE $Drive /Delete /Persistent
USE $Drive "\\$Server\$Share"
If @error=0
color g+/n
$x=" - Success"
"$x"
Else
color r+/n
$x=" - Failed: Error @error"
"$x"
$ErrorState=1
Endif
WriteLog ($LogText + $x)
Color w+/n
Else
WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'") Endif
Endfunction
;
;And THEN put in
;

IF InGroup("UserGroup")
MapDrive("P:", "Venus", "Data")
Endif

????

{edit} Added code tags. - Bullock

[ 25. November 2002, 21:16: Message edited by: Howard Bullock ]