NTDOC, you are correct, there is something wrong elsewhere in the script. As a test I extracted the problem line and the UDF call to a separate script, and it worked perfectly. So something in the login script seems to be the culprit. I've posted it below, and I'm sure its fraught with errors so please be gentle. But any suggestions in addition to my issue are welcome
Code:
if NOT @LOGONMODE
Break On
EndIf
Dim $RC
; $RC = SetOption("Explicit","On")
$RC = SetOption("NoVarsInStrings","On")
$RC = SetOption("NoMacrosInStrings","On")
$RC = SetOption("WrapAtEOL","On")
Dim $Mapdrv, $Mapprn, $RegTweak
call "\\****\netlogon\UDF\mapdrive.udf"
call "\\****\netlogon\UDF\mapprint.udf"
CLS
? "Mapping Company Share to G: "
$Mapdrv = Mapdrive('G',\\****\company,0,'Company')
@ERROR
IF INGROUP("administrators")
? "Mapping Admin Install Share to X: "
$Mapdrv = Mapdrive('x',\\****\ClientApps,0,'Install Share')
@ERROR
ENDIF
IF INGROUP("MCR Employees")
? "Mapping MCR Share to M: "
$Mapdrv = Mapdrive('M',"\\****\MCRSys$",0,'MCR Share')
@ERROR
ENDIF
? "Performing Registry Tweaks"
? "Setting WinXP Update Path "
WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup", "SourcePath", "\\****\ClientApps\Microsoft\WinXP with SP2", "REG_SZ")
If @ERROR = 0
? "Value written to the registry"
Endif
? "Mapping Printers"
$Mapprn = AddPrinter('\\****\fax',"",)
?"Shared Fax "@error ?
$Mapprn = AddPrinter("10.0.0.103","HP Color LaserJet 2500 PCL 6","C:\clj2500\hp2500p6.inf","HP Colour (Copy Room)")
?"CLJ 2500 "@error
IF INGROUP("Students")
$Mapprn = AddPrinter('\\****\HP 3030',"",)
? "MFC HP3030 (Student Area) "@error
ENDIF
Sleep 5
The output I get is the following:
Mapping Company Share to G: 0
Mapping Admin Install Share to X: 0
Mapping MCR Share to M: 0
Performing Registry Tweaks
Setting WinXP Update Path 0
Value written to the registry
Mapping Printers
Shared Fax 0
The system cannot find the file specified.
CLJ 2500 -2
Once again, thanks in advance for your help.