Motivation: when doing automation tests, we might need fake printers.
Procedure for installation:
- Control Panel -> Printers -> Add Printer
- Select Local Printer, uncheck "Automatically detect and install my Plug and Play printer", click Next
- Instead of selecting an existing port, select "Create a new port" and select type as "Local Port"
- Enter a port name (e.g. fakeprinter. Note that the default path for this is C:\Windows\System32)
- Choose "Generic" as Manufacturers, and "Generic/Text Only" as Printers type (Note: you may be able to choose any other type of printer, like HP, Apple).
- Options: If you want to delete a printer port you just created, first delete the printer that is using the port. Then go to "Printers" windows, click "File->Server Properties->Ports". There you have authority to delete a print port.
Procedure for using the fake printer from windows cmd (lanman printing)
- In cmd, run "net use lpt2: \\<samba-or-windows-server>\<fake-printer-name>"
- Options: if you want to disconnect a mapped drive, simple type "net use x: /delete", where x: is the driver letter of the shared resource
- To print your file to fake printer, just use "copy
lpt2" (check the file C:\Windows\System32\ to make sure it is updated)
No comments:
Post a Comment