Net Use LPT1 : The Network Location Cannot Be Reached

I am trying to capture LPT1 for use with a generic printer driver that runs on a port that creates a text file.

Here are the steps I use:

- Add a Generic Text Printer

- Create a new Local Port for the printer and name it C:\temp\PrintThis.txt (as an example)

- Share the Printer with the share name GenericT

Then I use Net Use to capture LPT1 to the shared generic printer like this:

       Net Use LPT1 \\machinename\GenericT /persistent:yes

This works fine as long as the machine is connected to ANY sort of network connection. I can connect a cable to a DSL modem and it will work but if the cable is disconnected I get the following error:

       System Error 1231 has occurred

       The network location cannot be reached. For information on network trouble shooting see Windows Help.

Any thoughts?
Who is Participating?
KenneniahConnect With a Mentor Commented:
Go to Regedit and browse to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

Hit Edit|New>DWORD Value, name it "DisableDHCPMediaSense" and set the value to 1

This will stop Windows from detecting the cable being unplugged and therefore unbinding File and Print Sharing etc.
After doing that, reboot and your problem should go away.
tdantonaAuthor Commented:
You Sir, are my hero, Thanks!!  :-)
Most welcome, glad it worked out for you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.