NetSoft Computer Networks
Last Updated
March 10th
1997

Mirror Sites
NetSoft LAN
Download the
Software

Network Card
Drivers

Secure
Features
User's Guide
Help
VeriSign

Search
Distribution
Rights

Listserv
Shareware Links
Order Now
Order the
Software

Help Us
Promote
NetSoft LAN

Dealer
Enquires
Welcome

Home Page
http://www.netsoft.ie/
CHAPTER 3

The NET Command


NET Command Syntax Chart


SymbolsPurpose
{ }Braces indicate a parameter you must use
[ ]Brackets indicate an optional parameter
|Bar indicates a choice of parameters
d:Indicates a drive letter from A: to Z: (LASTDRIVE= parameter must be set in your CONFIG.SYS file if you wish to use drives F: through Z:)
pathIndicates a drive and directory (e.g. C:\ACCOUNTS)
password1-8 or 1-16 character password
/rights/R /W /RW /WC /RWC Read, Write, Create (only take effect if PROTECT.COM is loaded)
deviceA DOS device name: PRN, LPT1, LPT2, LPT3 or LPT4, COM1, COM2, COM3 or COM4
network name1-8 characters that represent a drive and path or device name
computername1-15 characters identifying a computer starting with a double backslash ('\\')
number1-25 digit telephone number that may include Hayes dial syntax commands
commandAny valid NET command or sub command
/dIndicates that you wish to cancel a previous NET SHARE command or NET USE command

You must include all punctuation (except braces, brackets and bars) such as periods, equal signs, forward slashes and backslashes, where illustrated in the syntax.

NET PRINT


The NET PRINT command is similar to the DOS PRINT command. The former, however, is preferable for printing with network printers.

If you use the DOS PRINT command on a server machine that has the network printer spooler (SPOOLER.COM) loaded, the following message will be displayed by the DOS PRINT command:

Cannot use PRINT - Use NET PRINT

Before you can print using a network printer, the network printer spooler (SPOOLER.COM) must be loaded on the print server machine, and the printer redirector (PRNREDIR.COM) must be loaded on the client machine. If you are a client and a server, simply load-both of them.

In addition, the device you are using as the print device, must be redirected to the network printer you wish to use. This is done by using the NET USE command. (see page 19).

The NET PRINT command sends a file to the network printer queue. It can also display a print queue list for any network printer you are connected to.

Printing files using NET PRINT

Syntax: NET PRINT [d:][path]{filename.ext} {device}

Example of printing a file called READ.ME on the network printer associated with LPT1:

NET PRINT READ.ME LPT1

This command will send the file READ.ME to the network printer queue.

The local LPT1 must be redirected (connected to) a network printer using the NET USE command.

Displaying the printer queue

To confirm that your print job (the READ.ME file) is in the print queue, use the NET PRINT command to display the current print queue for LPT1.

Syntax: NET PRINT {device}

Example of viewing the print queue for the network printer associated with (connected to) LPT1:

NET PRINT LPT1

This command will display a print queue list similar to that shown below:

NET PRINT

Other ways to print

Below are some other ways you can print to network printers.

Copying files to the spooler directory

If you are printing large documents, it is easier to copy these into the network printer's spool directory. The network printer spooler will automatically detect these and print them to the printer attached to LPT1 on the print server machine.

Using this method you do not need to load the printer redirector (PRNREDIR.COM) on the client machine. In addition, documents copied to the spool directory always print on the first printer (LPT1).

Using the DOS COPY command

Instead of using the NET PRINT command, you can also copy files to the network printer using the standard DOS COPY command. Simply copy the file you want printed to the device that is connected to the network printer (PRN, LPT1, LPT2, LPT3, or LPT4).

To copy a file to the network printer associated with LPT2, use the following DOS command:

COPY /B READ.ME LPT2


NOTE The /B parameter must be used for binary files, or they may not print correctly. This is because DOS interprets control characters when copying files to character devices.

[Top of Page]
[Chapter 4] [Chapter 2]
[Table of Contents] [Home Page]

Prices and World Wide Ordering Information

Copyright © 1997 NetSoft Computer Networks. All Rights Reserved.
20 Sea Road, Galway, Ireland.
Tel (353)+91-529607.