Mark M Manning

A site for information involving myself and my career.

Creating a Fake Printer (/dev/null for Windows)

Wednesday, January 14, 2009

These directions will create a printer in Windows that will receive print jobs and then automatically delete them. This is probably only going to be useful for one in a million situations but I thought it was an interesting exercise none the less. If anyone does find this useful, I'd be interested to hear about it.

The reason I did this was because a program was hard coded that when you press the print icon, it would print. Then it would ask you if you wanted to print and select a which printer to print to. It would cause pages to be printed twice, and no matter where you wanted to print, they would go to your default. So I changed the default to just dump them using the Windows NUL function which works the same as /dev/null in Linux.

  1. Open up your printers and go to "Add Printer"
  2. Add it as a local printer and uncheck "Automatically Detect"
  3. Click on "Create a new port:"
  4. Choose "Local Port"
  5. The port name is "nul" (yes one "l")
  6. Name the printer Printer of Death (or whatever you want)

Test it by printing something out. A better test to believe that "nul" works is to run this from command line:

Normally this would print out to a file named "nul" if the concept of nul didn't work

Labels: ,