Showing posts with label ip printer. Show all posts
Showing posts with label ip printer. Show all posts

Tuesday, July 26, 2011

Print to IP printer at DOS Command

In the DOS command prompt, create a batch file and type the following code:




For /R %CD% %%I in (*.PRN) do (
  @echo printing %%I
  LPR -S 192.168.1.100 -P raw %%I
)




The 192.168.1.100 is your network printer's IP address. It should be changed accordingly.


This program reads all *.PRN and print them to the specified IP printer.

Monday, July 18, 2011

Change default printer

Declare Long GetLastError In WIN32API
Declare Long SetDefaultPrinter In WINSPOOL.DRV String pPrinterName


xPrinterName = "New Printer"
xDefaultPrinter = Set("printer", 2)
If SerDefaultPrinter(xPrinterName) = 0
  MessageBox("Unable to set the " + ;
             xPrinterName         + ;
             " as the default printer", 0 + 16)
Else


  && insert your code here...


EndIf


SerDefaultPrinter(xDefaultPeinter)