Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking to automate some printing in Windows 7. Ideally from command line. Just as if I would've right-clicked and selected "Print".

Tried the command:

C:\>print /D:"CutePDF Writer" test.txt

That printer is supposed to created PDF files (like the XPS printer) but haven't managed to get anything show up in the printer queue. Ideas?

share|improve this question
    
    
Similar to yours question stackoverflow.com/questions/5104930/how-to-print-through-cmd –  Ishikawa Yoshi Sep 21 '12 at 13:38
    
Are you trying to create PDF files or print them (or both)? –  martineau Sep 21 '12 at 14:01
    
@martineau I'm trying to create PDF files by using that "printer". So I guess both. But I'm not looking to get physical papers. –  mizipzor Sep 24 '12 at 6:56
    
@mizipzor: OK, I understand. I think Dennis has your answer. I would assign it to LPT1 if possible, which is the default for most commands. –  martineau Sep 24 '12 at 7:17

1 Answer 1

up vote 5 down vote accepted

The print command uses the following synatx for the /d: switch:

Specifies the printer on which you want to print the job. You can specify a local printer by specifying the port on your computer to which the printer is connected. Valid values for parallel ports are LPT1, LPT2, and LPT3. Valid values for serial ports are COM1, COM2, COM3, and COM4. You can also specify a network printer by its queue name (\ServerName\ShareName). If you do not specify a printer, the print job is sent to LPT1.

This means you can't use "CutePDF Writer" as an argument.

There are two ways that should work:

  • Assign a COM port to your printer.

    1. Open Start → Control Panel → Devices and Printers.
    2. Right-click the CutePDF Writer and select Properties.
    3. In the Ports tab, assign an unused port from COM1: to COM4: to your printer.
    4. If you chose, e.g., COM3, print using the following command:

      print /d:COM3 test.txt
      
  • Share the printer.

    1. Open Start → Control Panel → Devices and Printers.
    2. Right-click the CutePDF Writer and select Properties.
    3. In the Sharing tab, decide to share the printer and assign a share name to it.
    4. If you chose, e.g., CutePDF, print using the following command:

      print /d:\\%COMPUTERNAME%\CutePDF test.txt
      
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.