How to Check if an LPT Port has a Device Attached
Keywords: LPT1
Question:
How do I check that a port (LPT1) has a device on it prior to trying to print to it?Answer:
One of our users reported the following:I remember using a program a few years ago called SAFESEND (Shareware) that was used to check and see if a Port (or disk drive, I used it to check to see if a drive letter was a hard disk or CD) existed, and then create a DOS Errorlevel that could be checked in a batch file.
The best part about this program is that it would NOT get the infamous Abort,Retry,Fail error if the device was not there and it could also send ANYTHING (Esc codes, etc.) to a printer.
I haven't seen it around for a while but you should be able to find it on one of the (MANY) Shareware file archives on the net.
Article ID: W13688Filename: Check if LPT Port has a Device Attached.txt