Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
You will first you have to delete the printer, then pPrtAddConn to add it back in.
AddExtender("WWPRT34i.DLL") GetPrinterList = pGetPrtList(0) b=pGetDefPrtInf(1) message('',b) :Building1 ;Our last script had 98 entries like the one below.. Printer1=StrIndexWild(GetPrinterList,'OLD PRINTER NAME','1') If Printer1 != 0 pDelPrtConn('\\OLDSERVER','PRINT QUEUE') pAddPrtConn('\\NEWSERVER','PRINT QUEUE') EndIf
AddExtender("WWPRT44i.DLL") Plist=pGetPrtList(0) Pcount=ItemCount(Plist,@tab) for a=1 to Pcount PrinterX=ItemExtract(a,Plist,@tab) origdir = DirScript() printers=inireadpvt("Printers", "%PrinterX%", "0", "%origdir%\printernames.ini") if printers==0 then goto NoChange compareprinters = StriCmp(PrinterX, printers) if compareprinters==0 message("No Change Needed","Did not change printer") ;Used temporally to display actions taken, add ';' in front to remark out. else Message("Making Printer Change","Changing Printer from %PrinterX% to %Printers%") ;Used temporally to display actions taken, add ';' in front to remark out. prxfix=StrClean(printerx, "\", " ", @false, 1) prxfix2=StrTrim (prxfix) prxfix3=StrClean(prxfix2, " ", '"', @false, 1) ServerNamex=Itemextract(1,prxfix3,'"') Sharex=Itemextract(2,prxfix3,'"') prfix=StrClean(printers, "\", " ", @false, 1) prfix2=StrTrim (prfix) prfix3=StrClean(prfix2, " ", '"', @false, 1) ServerName=Itemextract(1,prfix3,'"') Share=Itemextract(2,prfix3,'"') ;pDelPrtConn("\\%ServerName%", sharex) Remove ';' to make active. Used to Delete Printers ;pAddPrtConn("\\%ServerName%", share) Remove ';' to make active. Used to Add New Printers Endif :NoChange Next
Article ID: W16662
File Created: 2005:02:18:12:21:48
Last Updated: 2005:02:18:12:21:48