![]() |
LPT Ports in Logon Scripts |
||||||
Kenn's
19981003: LPT Ports in Logon Scripts
October/1998
|
Before departing for the richer pastures of the west, Kevin C. highlighted a logon script issue which should be noted. He had a school in which a shared printer was physically connected to one of the workstations, was connected in the login script as LPT1, and which, as a result, wasn't working all that great. As a matter of standard practice in the division we start network printer connections at LPT2, and number upwards from there. Although Windows supports the use of virtual ports on systems that have a conflicting physical port, in practice, this causes problems. The system which has both the physical and virtual ports connected to the same printer will generate network errors, in some case causing infinite print job loops. If you're lucky, it simply doesn't work. If you're unlucky, you get very bad network congestion. If you migrate your login scripts to Kix, you can use LPT1 again, assuming you use an IF @wksta<>"SCHxxx" ... ENDIF block to contain the printer connection, where SCHxxx is the node name sharing the printer. This then ensures the sharing computer never connects to its own reshared resource. To give you an example, suppose your existing Kix script contained these lines: ? "Connecting to printer on Workstation 509..." USE LPT1 "\\SCH509\DESKJET1" IF @ERROR COLOR r+/n ? "Problem @error. Unable to connect." SLEEP 2 COLOR w/n ELSE ? "... connected successfully." ENDIF... I would expect a problem the first time the user at SCH509 went to print to LPT1, which is physically connected to the printer and virtually connected to the network connection to the share of the same printer! As I said above, changing the network connection to LPT2 fixes the problem, but with Kix, you can work around it by adding one additional line at the beginning and end: IF @WKSTA<>"SCH509" ? "Connecting to printer on Workstation 509..." USE LPT1 "\\SCH509\DESKJET1" IF @ERROR COLOR r+/n ? "Problem @error. Unable to connect." SLEEP 2 COLOR w/n ELSE ? "... connected successfully." ENDIF ENDIFThis ensures that the LPT1 network connection will never occur on SCH509 itself. However, even with Kixtart, many lab facilitators may prefer the reshare on a higher port, because with that configuration even the sharing computer can connect to its own shared resource on the virtual port, assuming the printer is reshared via Windows NT. So bottom line, avoid using LPT1 in logon scripts. Use it with caution in Kix scripts, but never in batch files. Even if you have more than two network printers, you can still number upwards. Windows 95 supports LPT4, 5, etc. with no additional alterations. Windows 3.1x requires only an additional line in WIN.INI to allow the use of higher-numbered LPT ports. (Eg. In the [ports] section just add the line "LPT4:=" without the quotes to add LPT4 to the list of parallel ports Windows will recognize.) |
||||||
DISCLAIMER: This document is intended for the reference of computer support personnel within Winnipeg School Division No. 1. There is no warranty or liability if procedures recommended here have an adverse affect on any systems. Use them at your own risk. Any trademarks mentioned are the property of their owners, none of whom have certified any information provided here. Opinions expressed here are personal only and do not represent the policy of Winnipeg School Division No. 1 or any other organization anywhere.
|