PRINT TO A NETWORK PRINTER FROM MS-DOS SOFTWAREThe 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 NAMEThe 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.
FIND A REDIRECTED PRINTERThe 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 SETTINGSThe 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 WINDOWThe 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 FAILSThe 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 FOLDERThe 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:
|