Hi

Firstly apologies for reposting this subject but its driving me rount the twist. [Confused] I also am trying to migrate users network printers between two print servers as per the link here.

Previous thread

Unfortunately I cannot get NTDocs/Lonkeros code to work and would appreciate and help or recommendations.
I have enclosed the script file which I am calling from my main login script.

code:
 

Break on

$pmap="\\shaw\netlogon\PRINTERS.INI"

FOR each $key in split(readprofilestring("$pmap","PRINTER_MAP",""),chr(10))
IF primapstate($key)
$nul=addprinterconnection(readprofilestring("$pmap","PRINTER_MAP",$key))
IF primapstate($key)=2
$nul=SETDEFAULTPRINTER (READPROFILESTRING("$pmap","PRINTER_MAP",$key))
ENDIF
$nul=delprinterconnection($key)
ENDIF
NEXT


Function PriMapState($_Pri)
IF len(readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices",$_Pri))
IF instr(readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device"),$_Pri)
$PriMapState=2
ELSE
$PriMapState=1
ENDIF
ENDIF
EndFunction


Heres the ini file that I am using for the printer mappings!

[PRINTMAP]
\\beckett\HP-CLR=\\dubrovfs01\HP-CLR
\\beckett\hp4000d1=\\dubrovfs01\hp4000d1
\\beckett\hp4050d1=\\dubrovfs01\hp4050d1
\\beckett\hp4100d1=\\dubrovfs01\hp4100d1
\\beckett\hp5si2=\\dubrovfs01\hp5si2
\\beckett\hp5si3=\\dubrovfs01\hp5si3
\\beckett\hp5si5=\\dubrovfs01\hp5si5
\\beckett\hp5si6=\\dubrovfs01\hp5si6
\\beckett\hp5si7=\\dubrovfs01\hp5si7
\\beckett\hp5si8=\\dubrovfs01\hp5si8
\\beckett\hp5si10=\\dubrovfs01\hp5si10
\\beckett\hp5si11=\\dubrovfs01\hp5si11
\\beckett\hp5si12=\\dubrovfs01\hp5si12
\\beckett\hp5si13=\\dubrovfs01\hp5si13
\\beckett\hp5si14=\\dubrovfs01\hp5si14
\\beckett\hp5si15=\\dubrovfs01\hp5si15
\\beckett\hp5si16=\\dubrovfs01\hp5si16
\\beckett\hp5si17=\\dubrovfs01\hp5si17
\\beckett\hp5si18=\\dubrovfs01\hp5si18
\\beckett\hp5si19=\\dubrovfs01\hp5si19
\\beckett\hp5si23=\\dubrovfs01\hp5si23
\\beckett\hp5si25=\\dubrovfs01\hp5si25
\\beckett\hp5si26=\\dubrovfs01\hp5si26
\\beckett\hp5si28=\\dubrovfs01\hp5si28
\\beckett\hp5si29=\\dubrovfs01\hp5si29
\\beckett\hp5si30=\\dubrovfs01\hp5si30
\\beckett\hp5si31=\\dubrovfs01\hp5si31
\\beckett\hp5si32=\\dubrovfs01\hp5si32
\\beckett\saturn=\\dubrovfs01\saturn

I have an NT Domain with mixed NT/W2K clients.

TIA