This article describes how to print files that contain raw printer data(.prn or .ps files) in Windows. These files are created by printingfrom a program to a file by using a Printer Control Language (PCL) or PostScript printer driver. A .prn file is typically created by using a PCL printer driver, and a .ps file is typically created by using a PostScript printer driver.
How to Print from a Command Prompt
To print from a command prompt, type copy pathfile name.file name extension LPT port number /b, and then press ENTER, where:
path is the path to the folder that you want to use to store the file
file name is the name that you want to give the file that you are making
file name extension is the file name extension for the file that you are making
port number is the number of the printer port that your printer is using, typically LPT1
For example, if you want to make a file that is named Rawprint.txt, save this file to the desktop, and your printer is connected to LPT1, you would type copy c:\windows\desktop\rawprint.txt lpt1 /b at a command prompt, and then press ENTER.
How to Enable Drag-and-Drop Printing for .prn or .ps Files
To enable drag-and-drop printing for .prn or .ps files:
Use any text editor (such as Notepad) to create a file that is named Printer.bat.
Type copy %1 lptport number /b in the Printer.bat file, where port number is the number of the printer port that your printer is using. Note that the port is typically LPT1. For example, if your printer is connected to LPT1, you would type the following command:
copy %1 lpt1 /b
Save the file in the Windows folder.
Click Start, point to Programs, and then click Windows Explorer.
On the View menu, click Options.
On the File Types tab, click New Type.
In the Description Of Type box, type Printer.
In the Associated Extension box, type PRN or PS, depending on your printer driver, and then click New.
In the Action box, type print.
In the Application Used To Perform Action box, type c:\windows\printer.bat.
Click OK, and then click Set Default.
Use Windows Explorer to locate the Printer.bat file in the Windows folder.
Right-click the Printer.bat file, and then click Properties.
Click to select the Close On Exit check box on the Program tab, and then click OK.
Create a shortcut to the C:\Windows\Printer.bat file on the desktop. To do this, right-click the Printer.bat file in the Windows folder, point to Sent To, and then click Desktop (create shortcut).
NOTE: If you are printing to a network printer, you must redirect an LPT port to your network printer. For information about how to capture a port for your network printer, view the "To Capture a Printer Port" topic in Windows Help.
How to Print .prn or .ps Files After You Enable Drag-and-Drop Printing
IMPORTANT: For correct output, you must create the file by using the same printer type as the printer that you plan to use to print the file. For example, you must send a file that you created with a PCL printer driver to a PCL printer, and a file that you created with a PostScript printer driver must be sent to a PostScript printer.
To print .prn or .ps files after you enable drag-and-drop printing, useany of the following methods:
Drag a file onto a printer icon.
Drag a file onto the Printer.bat shortcut that you made on your desktop.
Right-click the file that you want to print, and then click Print.