Windows shares not available on local machine with network cable unplugged.

Posted on 2007-10-08
Last Modified: 2013-12-23
Has anyone else noticed that shares on a machine are not even available on the local machine if the network cable is unplugged?

We create a share (say c:\share) and map it to \\mylocalmachine\share

We can access this from the local machine using the unc \\mylocalmachine\share.
Unplug the network drive and we get the message "\\ymlocalmachine\share is not accessible. You might not have permission to use this network resource.. blah blah blah

Does anyone know how to make that work. I *had* assumed it would use the local loopback driver.
Question by:tjsbbi
    LVL 7

    Expert Comment

    Just a guess, but does it have to do with DisableDHCPMediaSense? If you pull the network cable XP/Wk3 will disable the network and the nic driver so it stops trying to communicate with the domain (if your on one) and thus will turn off file/print sharing service that is running on the network card.

    other option would be if your a member of the domain and trying to give access to domain users instead of local users, thus not being able to authenticate the domain users when the cable is pulled.

    Would lean heavier toward option 1 though...

    2 options off the top of my head...

    Author Comment

    Well the computer is actually using a static ip address. However I tested this with a DHCP setup but it doesn't work. The share still becomes unavailable when the cable is unplugged.

    We are not using any domain users.

    What we are trying to do is have the application continue to work for a local user of that machine when it is unplugged from the network. We are using a share name because when it *is* connected to the network users on different machines connect using the share. And the software is configured with a well-known share name.
    LVL 4

    Expert Comment

    It sound like a drive mapping persistence issue.  You can force the share to always be there by using this vbs login script.

    Dim WSHNetwork, objNetwork, clDrives, boolPersistent
    Set objNetwork = WScript.CreateObject("WScript.Network")
    Set WSHNetwork = WScript.CreateObject("WScript.Network")
    boolPersistent = True ' True = Persistent ; False = Not Persistent

    On Error Resume Next
    'Disconnect ALL mapped drives
    Set clDrives = WshNetwork.EnumNetworkDrives
    For i = 0 to clDrives.Count -1 Step 2
    WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, True

    'Map all drives
    objNetwork.MapNetworkDrive "H:", "\\mylocalcomputer\share", boolPersistent

    Author Comment

    This is an interesting script however the issue is that \\mylocalcomputer\share is not accessible when the network cable is unplugged. (Even though the share is on this computer).

    We aren't really trying to map a logical drive but if we *were* then this script will fail because \\mylocalcomputer\share cannot be reached if the network cable is unplugged.

    Really it looks like the problem is similar to Isigow: suggestion of DisableDHCPMediaSense. Windows detects that the network cable is unplugged and denies requests that require the network stack (even though localhost is still there).
    LVL 4

    Expert Comment

    Sorry about that, thanks for the clarification.

    Author Comment

    Ok. We've found a solution.
    It seems that the loopback is *not* installed. I had incorrectly assumed that the functionality was based on the loopback driver.
    So I installed the loopbackdriver and left it to dhcp (the default). When there's no network it allocates a local number. The network shares are then all still available when the computer is not connected to a network.

    Thanks to everyone
    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
    Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 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

    10 Experts available now in Live!

    Get 1:1 Help Now