Pech,

Let's go back and look at Howard's code..

Can you post the results of - "%temp%\logon.log" back here please?

If we take what you have and combine it with Howard's code, it should be something like:
code:
 ? @kix
? @dos
? @ldrive
;;USE "*" /delete ;-- commented this out as the MapDrive function takes this into account
;;? "delete persistent mappings: "
MapDrive("h:", "\\bstl_svr3", "@userid$")
? "mapping h: to homeshare: "

IF Ingroup ("EDPADMIN") = 1
MapDrive("i:", "\\bstl_svr3", "DocEDP$")
? "mapping i: to groupshare: "
MapDrive("j:", "\\bstl_svr3", "dept$")
? "mapping j: to groupshare: "
MapDrive("k:", "\\bstl_svr3", "users$")
? "mapping i: to groupshare: "
MapDrive("l:", "\\bstl_svr3", "Software$")
? "mapping i: to groupshare: "
SHELL "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF

? "logonscript ran"
? "press any key to close window"
GET $

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


FUNCTION WriteLog($text)
DIM $rc, $text, $logfile, $filehandle
$filehandle = 1
$logfile = "%temp%\logon.log"
$rc=Writeline ($filehandle, "@Date @Time - $Text" + Chr(13) + Chr(10))
IF $rc<0
$rc=Close ($filehandle)
$rc=Open ($filehandle, "$LogFile", 5)
SELECT
CASE
$rc=-1
$rc=MessageBox ("Invalid file name ($LogFile) specified for log file.","Logon Script Error",48)
CASE
$rc=0
WriteLog ($text)
CASE
$rc=>0
$rc=MessageBox ("Error($RC) while attempting to open log file ($LogFile).","Logon Script Error",48)
ENDSELECT
ENDIF
ENDFUNCTION

Thank you,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's