Home > Commands N-Z > Commands P

PRINT


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Prints a text file while you are using other operating system commands.

This command can print in the background if you have an output device connected to one of your system's serial or parallel ports.


Syntax

PRINT [/D:device] [/B:size] [/U:ticks1] [/M:ticks2] [/S:ticks3] [/Q:qsize] [/T] [[drive:][path]filename [ ...]] [/C] [/P] [...]

To install PRINT with the default parameters or to display the contents of the print queue on your screen without affecting the queue:

PRINT


Parameters
drive: ( path filename v2.0 Win95 ONLY NT3.5)
Specifies the location and name of a file or set of files you want to print. You can include multiple files (usually as many as 10) on one command-line.

Switches
/B:size (v2.0 Win95 ONLY)
Sets the size (in bytes) of the internal buffer, which is used to store data before it is sent to the printer. The minimum and default value for size is 512; the maximum value is 16384. Increasing this value decreases the amount of memory available for other purposes but may speed up the PRINT command.
/C (v2.0 Win95 ONLY)
Removes files from the print queue. You can use the /C and /P switches on the same command-line.
When the /C switch precedes the list of filenames on the command-line, it applies to all files whose names follow the /C switch, until PRINT encounters a /P switch, in which case the /P switch applies to the file whose name precedes the /P switch.
When the /C switch follows a filename, it applies to the file whose name precedes the /C switch and all files whose names follow the /C switch, until PRINT encounters a /P switch, in which case the /P switch applies to the file whose name precedes the /P switch.
/D:device (v2.0 Win95 ONLY NT3.5)
Specifies the name of the print device. Valid values for parallel ports are LPT1, LPT2, LPT3, and PRN. Valid values for serial ports are COM1, COM2, COM3, and COM4. The default value is LPT1, which is also called PRN. The /D switch must precede any filename used on the command-line.
/M:ticks2 (v2.0 Win95 ONLY)
Specifies the maximum number of clock ticks PRINT can take to print a character on the printer. Values for ticks2 must be in the range 1 through 255. The default value is 2. If a character is printed too slowly, the operating system displays an error message.
/P filename [...] (v2.0)
/P path\filename [...] (v3.30 Win95 ONLY)
Adds files to the print queue. You can use the /C and /P switches on the same command-line.
When the /P switch precedes the list of filenames on the command-line, it applies to all files whose names follow the /P switch, until PRINT encounters a /C switch, in which case the /C switch applies to the file whose name precedes the /C switch.
When the /P switch follows a filename, it applies to the file whose name precedes the /P switch and all files whose names follow the /P switch, until PRINT encounters a /C switch, in which case the /C switch applies to the file whose name precedes the /C switch.
/Q:qsize (v2.0 Win95 ONLY)
Specifies the maximum number of files allowed in the print queue. Values for qsize must be in the range 4 through 32. The default value is 10.
/S:ticks3 (v2.0 Win95 ONLY)
Specifies the number of clock ticks the operating system scheduler allocates for background printing. Values for ticks3 must be in the range 1 through 255. The default value is 8. Increasing this value can speed up printing while slowing down other programs.
/T (v2.0 Win95 ONLY)
Removes all files from the print queue.
/U:ticks1 (v2.0 Win95 ONLY)
Specifies the maximum number of clock ticks PRINT is to wait for a printer to be available (clock ticks occur about 18 times per second). If the printer is not available within the time specified, the job does not print. Values for ticks1 must be in the range 1 through 255. The default value is 1.

Related

For information about configuring a printer connected to a parallel port, see the MODE (configure printer) command.
For information about displaying the status of a printer, see the MODE (display device status) command.
For information about configuring a printer connected to a serial port, see the MODE (redirect printing) command.
For information about preparing printers for character-set switching, see the MODE (set device code pages) command.
NET PRINT - View and Delete print jobs.
DEL - Delete one or more files.
DEFPRINT - Command-line utility to set the default printer - download from: http://www.tardis.ed.ac.uk/~sda/defprint
Print Notification - this is set under Control Panel, Printers, File, Server Properties, Advanced
Equivalent Linux BASH commands:
printf - Format and print data.


Notes
Length of a PRINT queue entry

Each print queue entry can contain a maximum of 64 characters. Each queue entry includes the drive letter, directory, and any subdirectories.


Limitations on switches

You can only use the /D, /B, /U, /M, /S, and /Q switches the first time you use the PRINT command after starting the operating system. To use one of these switches after using PRINT, you need to restart the operating system.


Use an application's print command when possible

Many applications have their own print commands. You should use an application's print command to print files that you create with the application.


Examples

To view the status of the print queue, type:

    PRINT

The operating system displays the name of the file being printed (if any), the names of files in the queue, and an error message, if an error condition exists.


This command removes the PENCIL.TST file from the print queue:

    PRINT A:PENCIL.TST /C

The next command shows how to remove the file PENCIL.TST from the queue and add the file PEN.TST to the queue:

    PRINT PENCIL.TST /C PEN.TST /P

The remaining examples use switches that work only with the first PRINT command you use after starting the operating system.

This command sets up the print queue for printing on LPT1:

    PRINT /D:lpt1

To specify that the PRINT command is to wait 60 clock ticks for a printer to be available and that the operating system scheduler is to allocate 25 clock ticks to the PRINT command for background printing rather than the default value of 8 clock ticks, type:

    PRINT /U:60 /S:25

This example specifies that PRINT has 4 clock ticks available to print each character rather than the default value of 2 clock ticks:

    PRINT /M:4

To change the default maximum number of files for the print queue, use the PRINT command with the /Q switch:

    PRINT /Q:32

Errorlevels

none.


Availability
External Resident
DOS
v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1
Windows
Win95
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003