Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Installing an LPR Printer Port TCP IP Printer
Which is:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\LPR Port\Ports\155.25.111.22:NEWPRINTER]where 155.25.111.22:NEWPRINER is the new LPR Port you created to a reg file.
Then write a Winbatch Program to:
1.import that registry file
2. Stop the Spooler Service
3. Start the Spooler Service
4. Use PaddPrinter() function and under port specify the new LPR Port.
5. If you want you can make the new printer default using pSetDefPrt()
Here is the complete Winbatch Program that I used:
AddExtender("WWPRT32I.DLL") AddExtender("WWWNT32I.DLL") if RunShell("\\Server1\Share1\printerlpr.reg", "", "Z:\", @ICON, @WAIT) ; import registry else Message("Error","Could not import registry information") exit endif svstate=0 wntSvcControl("", "Spooler", 0, 1) ; stop the Spooler service TimeDelay(5) svstate=wntSvcStatus("", "Spooler",0, 2) if svstate <> 1 then wntSvcControl("", "Spooler", 0, 1) ; stop the Spooler service endif wntSvcStart("", "Spooler", 0, "", "") ; start the Spooler Service TimeDelay(5) svstate=wntSvcStatus("", "Spooler",0, 2) if svstate <> 4 then wntSvcStart("", "Spooler", 0, "", "") ; start the Spooler Service endif pAddPrinter("", "MYPRINTER", "155.25.111.22:NEWPRINTER", "Lexmark Optra S 1855", "WinPrint") ; Add Printer ret=pGetDefPrtInf (1) pport=pGetPrtInfo( "%ret%", 4) ; If pport=="LPT1:" then else pSetDefPrt ("MYPRINTER") End If
Article ID: W15675
File Created: 2003:05:13:11:29:26
Last Updated: 2003:05:13:11:29:26