#74361 - 2003-04-09 10:39 AM
Printer migration (again!)
|
Corky
Fresh Scripter
Registered: 2002-01-11
Posts: 13
|
Hi
Firstly apologies for reposting this subject but its driving me rount the twist. 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
|
|
Top
|
|
|
|
#74366 - 2003-04-09 11:40 AM
Re: Printer migration (again!)
|
Corky
Fresh Scripter
Registered: 2002-01-11
Posts: 13
|
Hi
Talk about a case of 'not being able to see the wood for the trees'. Apologies for taking up your time with such stupid mistake that I have been staring at for the last two days.
Again many thanks!
TC
|
|
Top
|
|
|
|
#74370 - 2003-04-10 12:02 AM
Re: Printer migration (again!)
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#74371 - 2003-04-09 02:59 PM
Re: Printer migration (again!)
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Corky,
This worked a treat..
Printer Migration
Notice: I used Doc's/Lonkero's code too. However, I had to make a small modification to do a USE LPT1: on it.
Kent [ 09. April 2003, 15:00: Message edited by: kdyer ]
|
|
Top
|
|
|
|
#74372 - 2003-05-06 07:30 PM
Re: Printer migration (again!)
|
Anonymous
Anonymous
Unregistered
|
NT DOC & Lonkero are right on track. After trying to figure out how everything is pieced together, it works like a charm! Thanks!
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1680 anonymous users online.
|
|
|