NETWORK PRINTING AND MS-DOS


PRINT TO A NETWORK PRINTER FROM MS-DOS SOFTWARE

The Annoyance:

I have a favorite MS-DOS program that I can't live without. I install it on every computer I buy. If the program is running on a computer with a printer attached to LPT1, there's no problem. If the computer relies on a network printer, I can't print.

The Fix:

Yes you can, and I do this all the time. I, too, have a favorite MS-DOS program that I can't live without. It's a small shareware database in which I've been storing information since 1984. It has my address book, family birthday and anniversary dates, credit card information, PINs and passwords, and other vitally important information. The computer I use most often doesn't have a printer, so network printers are my only resource. To print from MS-DOS, you must redirect printing using an MS-DOS command. To open a command window in Windows XP, select Start All Programs Accessories Command Prompt. (The menu names and sequence vary depending on your version of Windows.)

Enter the following command:

     net use lpt1 \\PrintServerName\PrinterShareName 

Notice the space between the port and the UNC. The system returns the following message: "The command completed successfully."

Specifying LPT1 works if the MS-DOS software is configured to use LPT1. If the software is configured for LPT2, change the command accordingly. Now you can use the print features in the MS-DOS software as if a printer were connected to the port you specified. The software never knows it's printing to a network printer.

The printer is redirected until you shut down the computer. If you don't want to enter the command every time you start the computer, you can make the redirection permanent. Add the parameter /persistent:yes to the command. For example, to use a printer with the sharename HP6P connected to a computer named Larry, enter net use lpt1 \\larry\HP6P /persistent: yes. Notice the space between the UNC and the parameter.

REDIRECT A NETWORK PRINTER WITH SPACES IN THE NAME

The Annoyance:

I tried to redirect a network printer to my local printer port, but when I entered the command, the system displayed the Help file for the net use command. I'm sure I entered the command correctly, so why didn't this work?

The Fix:

I suspect either the computer name or the printer sharename has a space. In that case, you must enclose everything from the double-backslash (\\) to the end of the command in quotation marks. For example, you'll need to type net use "\\sam\deskjet one" instead of \\sam\deskjet one.

UNDERSTANDING PERSISTENT CONNECTIONS

If you don't use the persistent parameter, MS-DOS automatically assigns connections as persistent or temporary using whichever option you used to make the last connection. In other words, MS-DOS remembers the last parameter you used and uses it as the default until you change it. So, if you use the persistent: yes parameter when you're working at the command line, the next time you redirect a connection you don't have to add the parameter because Yes is now the default.

A mapped drive is also a redirected connectionit's a network share that is assigned a local device name and drive letter. When you map a drive while working in My Network Places or Network Neighborhood, you can select the option to reconnect when Windows restarts. That's a persistent connection, and choosing that option sets the current state for persistent connections as Yes. This applies whether you use the command line or Windows interface to redirect a shared resource to your computer. (See Chapter 4 for information about mapping drives.)

To see whether the current state of a connection is persistent or temporary, enter net use at a command prompt. The first line of the display gives you the information you need:

  • "New connections will be remembered" means the current state is persistent.

  • "New connections will not be remembered" means the current state is temporary.


FIND A REDIRECTED PRINTER

The Annoyance:

I redirected a network printer to LPT1 on my computer. However, when I open the Printers folder, the network printer isn't configured for LPT1. Instead, the port is still listed as the remote computer. How can I tell whether the redirected printer is active and will work when I need it?

The Fix:

Redirecting the network printer to the local port has no effect on printing in Windows. To Windows, the network printer still looks like a network printer. You redirected the printer through an MS-DOS connection. To see whether the redirected printer exists, open a command prompt and enter the command net use. The system displays your current connections (see Figure 5-15).

Figure 5-15. Entering the net use command lets you see all your local connections, including redirected printers and mapped drives.


PERSISTENT CONNECTIONS ARE USER SETTINGS

The Annoyance:

I've set up persistent connections on every computer in the network, both for printers and for mapped drives. Sometimes the connections disappear when a computer is turned on, and sometimes they're there.

The Fix:

Well, it's tempting to say that Windows boots in a whimsical way, deciding arbitrarily whether it will cooperate with your configuration efforts. But it's not so, and there's a logical explanation for this annoying behavior you're seeing. Persistent connections are user-based configuration settings. I'll bet your household, like most households, has more users than computers, so users have to share computers.

The persistent connections you established are linked to the person who was logged on to the computer when you set up the connections. When another user logs on, those connections aren't reestablished. You must reconfigure them for this user, and for each user of every computer.

PRINT TEXT FROM THE COMMAND WINDOW

The Annoyance:

I've learned to appreciate the power of the command line, and I'm trying to learn as much as I can. I use the help text available in the command window, but I can't memorize each command's help. Isn't there a way to print the text?

The Fix:

You can print the help text (or any responsive text in a command window) by redirecting it to a printer port, such as LPT1. If a printer is attached to LPT1, the print job is sent there. If LPT1 is a redirected resource pointing to a network printer, the print job is sent to the network printer.

Responsive text is anything that appears after you enter a command. For example, if you enter net use, the system responds with a list of all your connections, and if you enter ipconfig, the system responds with information about your TCP/IP settings. If you want to preserve this information, the redirection feature lets you capture it.

To redirect the text to a printer, enter the following at the command line: command /? > lpt1. Use the actual command instead of the word "command"for example, print /? > lpt1.


Tip: You can redirect the responsive text in a command window to a file in the same manner by substituting a filename for LPT1. Open the file in a word processor if you want to work on it, or save it in your My Documents folder.

REDIRECTING HELP FILES TO THE PRINTER FAILS

The Annoyance:

I tried to redirect the help files for Net Use to my printer, but it didn't work.

The Fix:

Redirecting the output of help files doesn't work for commands that are twopart tools. Net Use is part of the Net command system, which includes other commands such as Net Time, Net Accounts, and many more. A number of other two-part commands also exist. The only way to print their help files is to access the Windows Help system.

PRINT THE CONTENTS OF A DRIVE OR FOLDER

The Annoyance:

I want a list of all the folders on my C drive, but there's no command named Print Contents on Windows Explorer or My Computer. I'd also like to print the names of all the files in specific folders, but I can't do that either.

The Fix:

This missing ingredient in Windows is really annoying. Luckily, the command line provides a fix. MS-DOS has a command named DIR, and you can redirect its output to a printer or to a file. Open a command window and navigate to the drive or folder whose contents you want to record. Then enter either of the following commands:

  • dir > lpt1 to print the list.

  • dir >filename to send the list to a file that you can open in a word processor (substitute a real filename for the word "filename").



    Home Networking Annoyances
    Home Networking Annoyances: How to Fix the Most Annoying Things about Your Home Network
    ISBN: 0596008082
    EAN: 2147483647
    Year: 2006
    Pages: 90
    Authors: Kathy Ivens

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net