Net Use LPT1 : The Network Location Cannot Be Reached

Posted on 2005-04-19
Last Modified: 2008-01-09
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?
Question by:tdantona
    LVL 24

    Accepted Solution

    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.
    LVL 24

    Expert Comment

    After doing that, reboot and your problem should go away.

    Author Comment

    You Sir, are my hero, Thanks!!  :-)
    LVL 24

    Expert Comment

    Most welcome, glad it worked out for you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    I wanted to pass this along in case anyone has a problem removing a device from the Device Manager, or if you suspect a corrupted Driver that you want to remove in its entirety. I know it is kinda lengthy and very basic in its format, but I figured …
    Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now