Windows 7 disconnected network drives

Mapped network drives have always been a buggy area in Windows, probably at least in part because they are still linked to a DOS namespace. From MSDN:

On Windows Server 2003 and Windows XP, the WNet functions create and delete network drive letters in the MS-DOS device namespace associated with a logon session…

Whatever the reason, it is commonly reported that mapped network drives appear as ‘disconnected’ in Windows Explorer (or ‘unavailable’ via net use), and that programs that attempt to use these drive mappings will fail until the user physically clicks on the drive letter in Windows Explorer. Only this user-initiated action will restore the connection and allow other programs to successfully read from the drive letter.

The dreaded disconnected network drive balloon.

This is a BIG problem!

I initially thought that the mapping of the network drives was being done before some required services had started (such as the Workstation and Server services), so I wrote a program to run on startup that attempted to map a drive and logged all the currently running services if it failed. It would keep trying to map a drive until it succeeded. I hoped it would show me which services needed to be running in order to map a drive, after which I would write a program to wait for those services before attempting to map anything. But, much to my amazement, I found that when the initial drive mapping failed and a subsequent attempt succeeded, the set of running services had not changed! So I could only conclude that there was another element in the equation. After thinking about this for a while, and reading this post, which indicates that Microsoft is apparently trying to address this, I decided ‘stuff it’, I’ll just write something that I know will work and is simple.

So I’ve written a small executable called MapDrive.exe to ‘work around’ this problem, described on the following dialog:

About MapDrive

Now as you may know since Vista, there is the concept of a split user token, and mapped network drives apply to only one token, so if you map drives as a standard user and then run an elevated process, those network drives are not available to the elevated process. This behaviour is documented by Microsoft, however the solution they offer is both unsupported and unsafe. Other solutions have been proposed here. If you don’t wish to use any of these solutions, you can do this:

1. Run MapDrive.exe as a shortcut from your Startup folder. This will map drives for the standard user token.
2. Run MapDrive.exe as a local group policy logon script using gpedit.msc. This will map drives for the administrator token.

Note: After using this program, you may still see the above balloon popup, simply click the spanner icon, and select ‘Hide icon and notifications’ for ‘Windows Explorer’.

Download the utility for free here.

UPDATE: A few people have asked how to use this program. As stated above, there are two ways, depending on whether you need drives mapped for standard users or admins. If you don’t know what you need, you probably just need to do this for standard users. Here are the steps for both:

1. Copy MapDrive.exe to somewhere on your local hard drive.

Standard Users:
2. Right-click MapDrive.exe and choose ‘Create Shortcut’. This will create a file called ‘MapDrive.exe – Shortcut’ next to MapDrive.exe. Now go Start->All Programs, right-click the ‘Startup’ folder and choose ‘Open’. Now copy the shortcut file you made before to this folder. Now right-click the shortcut file and choose ‘Properties’. Add the drive letter and network share as argument to the end of the ‘Target’ field e.g. “C:\Users\joeblogs\Documents\MapDrive.exe s: \\server\share 20”. You are done, next time you reboot, your s: should be mapped successfully for standard users.

Admin Users:
3. Press Win+R, type gpedit.msc, go User Configuration->Windows Settings->Scripts. Double-click Logon, click ‘Add’ and enter script name (no quotes): “C:\Users\joeblogs\Documents\MapDrive.exe” and script parameters (no quotes): “s: \\server\share 20”, ok, ok, done. You are done, next time you reboot, your s: should be mapped successfully for admin users (i.e. elevated programs).

72 thoughts on “Windows 7 disconnected network drives

  1. Rhys says:

    Hi I am having the same problem.
    Trying to access mapped drives on an OpenSolaris server that I connect to via CIFS Workgroup mode and network via my router.
    I tried using this program as an Admin and Standard user but couldn’t get it to work.
    As Standard the Target looked like:
    “C:\MapDrive.exe r: \\SERVER NAME\SHARE”
    The shares were named according to how they appeared on the actual server and UNC naming etc e.g. \\SERVER\tank_share.
    This is such an annoying problem as I can only make full use of the server if I “Sleep” the Windows 7 client, otherwise… restart and the drives are gone.
    The only solution I have found to this problem is to reboot the OpenSolaris server completely (while the Windows 7 PC is running) which is far from ideal.

  2. Mike says:

    Thanks for this!

    Just a tip since it took me a while to figure this out. If you have a space in your share, the syntax in the target field looks like this:

    network sever name and share: \\MIKEDESKTOP\(D) Media

    This works:
    “C:\Program Files\mapdrive\MapDrive.exe” p: “\\MIKEDESKTOP\(D) Media” 20

    This does not work:
    “C:\Program Files\mapdrive\MapDrive.exe” p: \\MIKEDESKTOP\(D) Media 20

    • Daniel says:

      Mike, when I paste your line into my target “C:\Users\PC1\My Documents\MapDrive.exe” v: “\\Brennan\f\Car Models” 20

      I have to replace your quotes with my Shift+2 quotes ” otherwise windows tells me the path does not exist? What type quotes are you using?

  3. Roy Martin says:

    This resolved the issue I was having where connecting to persistent mapped drives off of the domain would cause windows boot to hang 30-60 seconds. I adjusted my setting to be 5 seconds, and it appears to work very well.

    Thank you,

  4. David says:

    I had no luck with this using Window 7 Home. Method 1 seems to do nothing, and gpedit.msc doesn’t exist in Home apparently. This whole Win 7 local network sharing/mapping is very annoying and a big time waster. Thanks for trying to help though.

  5. David D says:

    I noticed this issue right away with Windows 7, and this utility works flawlessly! Great job and thanks!

  6. Edward says:

    I have a problem in configuring MapDrive and I hopefully you can help me. I presently have 3 network drives (d:,e: and f:) mapped under Win7. They appear as follows:
    wd_10 (d) (\\Server) (Q:), wd_11 (e) (\\Server) (R:) and wd_12 (f) (\\Server) (S:).

    I do not understand how to configure the targetfield of my MapDrive.exe shortcut. I always get: “The name specified in etc… not valid.” as a result.

    Kind Regards,
    Edward Sluijter
    The Netherlands

    • You have to run MapDrive.exe once for each drive you want to map. E.g. create three shortcuts as follows:

      [path to MapDrive.exe] Q: “\\server\wd_10 (d)” 20
      [path to MapDrive.exe] R: “\\server\wd_11 (e)” 20
      [path to MapDrive.exe] S: “\\server\wd_12 (f)” 20

      Hope that helps.

  7. Mike VM says:

    One question:

    Upon startup, I get a Map Drive window that says:

    Makes mapping drives on Windows7 startup reliable. Etc., etc. (for a whole paragraph).

    The window has an OK button at the bottom.

    How do I set things up so this doesn’t come up at startup, yet keeping the functionality of the utility?

    My setup has the MapDrive shortcut in the startup folder.



    • Mike, you need to follow the instructions in the post above, after you add the shortcut, you need to modify it to have some command line arguments specifying which drive letter should be mapped to which UNC path.

    • Houston says:

      Mr. Bungle. Great fix thank you! What is a spanner add. Having some minor difficulties getting rid of the pop up. Thanks.

  8. Mike VM says:

    Mr. Bungle,

    I did do that, although I might not have done it correctly.

    Here’s my instruction:

    “C:\Program Files\Zorn Mapped Folder Fix Software\MapDrive.exe” q:”\\\Cmpltd_Projects” 20

    See anything wrong there?



  9. Dave says:

    I have an XP Pro machine that maps a couple volumes hosted on a Mac using SMB. Once I got this working it was great. I keep all my work on these volumes, so my XP work files get backed up hourly by Time Machine.

    I have the same issue where mapping the drives does not happen reliably, I have a .bat file that gets called at XP startup, and I’ve had to resort to adding a 20 second delay before attempting to map the drives with net use. That seems to work pretty reliably, but the delay is kind of irritating.

    I tried out MapDrive.exe, but unfortunately I am not able to use it – I need to specify a username and password to mount these volumes, which apparently MapDrive.exe does not support…? Just curious whether you might add that in the future.



  10. Doug says:


    The program works great, although is it possible to map drives using a different credentials?

    I’ve tried using the normal syntax of h: \\server\share /user:username password but no joy.



    • Unfortunately, it’s not practical to add switches to allow username/password to be supplied on the command line, because then your password would be stored in plain text 🙁 If you can suggest a solution that doesn’t expose users’ passwords I’d be interested.

  11. Dirk says:


    Just wanted to say thank you for this wonderful program. It works perfectly and solves my problem of my home theater pc’s that do not have keyboards not connecting to the network shares. Thanks again.

  12. Andrew says:

    Could not get the program to work in either Standard User or Admin methods.

    Here’s what I tried using the Standard Method:
    “C:\Program Files\MapDrive\MapDrive.exe” “P: \\LOCALHOST\Network Shared” 20

    Here’s what I tried using the Administrator Method:
    “C:\Program Files\MapDrive\MapDrive.exe”
    P: “\\LOCALHOST\Network Shared” 20

    I have also tried this with the actual network name of the computer (THUNDERDOME) instead of LOCALHOST with the same results.

  13. Kern says:

    If you read through the posts you will find your answer.

    This works:
    “C:\Program Files\mapdrive\MapDrive.exe” p: “\\MIKEDESKTOP\(D) Media” 20

    This does not work:
    “C:\Program Files\mapdrive\MapDrive.exe” p: \\MIKEDESKTOP\(D) Media 20

    This does not work: I added your example, you have the quote before the P instead \\
    “C:\Program Files\MapDrive\MapDrive.exe” “P: \\LOCALHOST\Network Shared” 20

  14. Hello there,

    My desktop antivirus Avira Antivir detects Mapdrive.exe as being infected with the TR/ATRAPS.Gen trojan.

    Its online version too, see report:

    That report was generated scanning the download URL [] although it’s worth to note that is the only antivirus that detects anything so it might be a false positive. Perhaps you can send them your program so the whitelist it or something like that.


    • False positive.

      From Danirod:

      “Well, I’ve gone ahead and sent the mapdrive.exe to Avira so they can sort out the false positive. And surprisingly I got a quick response only a few hours later so it’ll be removed from the virus definition file on the next update.


  15. Houston says:

    Mr. Bungle. Great fix thank you! What is a spanner add. Having some minor difficulties getting rid of the pop up. Thanks.

  16. Dave Whittaker says:

    Hi thanks for the effort you have put into this but I am going to probably ask a stupid question but I’m finding how to type the syntax confusing i.e.

    You state for standard users :-
    C:\Users\joeblogs\Documents\MapDrive.exe s: \\server\share 20

    for admin users
    script name (no quotes): “C:\Users\joeblogs\Documents\MapDrive.exe”
    script parameters (no quotes): “s: \\server\share 20″

    So I have typed literally what you have said above no qoute marks anywhere but then other users have said :-

    This works:
    “C:\Program Files\mapdrive\MapDrive.exe” p: “\\MIKEDESKTOP\(D) Media” 20

    This does not work:
    “C:\Program Files\mapdrive\MapDrive.exe” p: \\MIKEDESKTOP\(D) Media 20

    I am confused they are saying one with qoutes works and one without doesn’t.

    please in plane english for a donut like me explain what I should type should my syntax for standard and admin have qoute marks or not

    • Sorry for the slow reply, you need to use quotes around any arguments that have spaces. So, for example:

      “c:\tools\directory with spaces\mapdrive.exe” \\server\share-with-no-spaces 20
      c:\tools\directory-with-no-spaces\mapdrive.exe “\\server\share with spaces” 20

  17. Peter says:


    Great tool! But unfortunately my university requires me to log on with different credentials. Any progress??

    • I thought about this, but adding the possibility for a command line option means the password would be stored in plain text somewhere, which is too much of a security risk to warrant, unfortunately. The password could be stored encrypted of course, but then that would require writing and additional UI for password entry, and would still mean that anyone could disassemble MapDrive.exe to steal passwords. So I think it may not be possible, sorry.

      • How about you leave it up to the administrators to decide how safe their environment should be rather than destroying an otherwise useful product?

        Not allowing input of a user-name/password requires to make the share unprotected which is even more of a security no-no than a plaintext password.

        Are you one of those people who advocates on Linux forums to forbid allowing solutions that involve logging in as root?

        • Mark says:

          Well said!

          Requiring a totally passwordless SMB is a *lot* more unsafe than storing a password in a script somewhere (a script that can, in admin case, only be read by admins anyway; and on a non-elevated account, the risk is, by definition, negligible to begin with).

  18. Richard says:

    Hi there, and thanks for making this tool, and having it freely available!

    When I try to run MapDrive, I get a .NET Framework Initialization Error — Unable to find a version of the runtime to run this application.

    I’m running Windows 7 Home SP1 64-bit. I have the .NET Framework 4 Client Profile installed.

    Any ideas as to what I might be missing?


    • Richard says:

      Turns out that the problem was… I had moved MapDrive.exe to \windows\system32\… once I moved it out of there and tried it again, it worked perfectly! Thanks!

  19. Nick says:

    When I got my syntax sorted out, I had it all set up exactly as you prescribe for a standard user, to map 3 drives from a wireless NAS server (Lacie Network space). I have Windows 7 64 bit

    When I boot my PC it clearly runs MapDrive as I get the window pop up, 3 times. On each occasion I hit OK and the boot process completes.

    However, my 3 mapped drives are still shown as unavailable and I have to go into ‘Computer’ and kick-start each one, just as before.

    Now, I take it as read that your software works, therefore the problem obviously lies between my seat and the keyboard.

    Any ideas where I might be stuffing up?
    Does it not necessarily work with wireless NAS’s?
    Should I not be hitting the ‘OK’ when it appears?
    I have increased time out to 60 secs just in case that was the problem

    Hope you can help



    P.S. Win 7 Library tool is fantastic!! Why are Microsoft making such a meal of this issue?

  20. ajacob says:

    Works well with the mapdrive (Y:) on my boot partition…does not work with my 2 others mapdrives on my raid (W: and X:). Any idea? The syntax seems correct, no popwindows from mapdrive.exe

    Script name:
    C:\Program Files\Zorn Mapped Folder Fix Software\MapDrive.exe
    for the 3 drives

    Script Parameters:
    W: “\\\Transfert” 20
    X: “\\\Projects” 20
    Y: “\\\LightWave10.0” 20

  21. Joe says:

    In Windows Explorer this is what is displayed for the drive I’m trying to connect: j (\\server) (J:)
    What should my syntax be for MapDrive.exe? I’ve tried various senarios but still have the red X on the drive symbol. Thank you.

  22. Art says:

    I have XP and 7 machines with the problem. Your program solved this most annoying bug. Thanks so much!

  23. George says:

    I guess I haven’t figure out the syntax yet because I keep getting the opening window. I have a MyBookWorld that I mapped as Z:. It shows in windows explorer as: Public(\\MyBookWorld)(Z:).

    My latest attempt is:
    “C:\Program Files\mapDrive\MapDrive.exe” Z:\\MyBookWorld 10

    What would be the correct syntax, please? Thanks

  24. ProfQ says:

    Just wanted to say thank you for such an elegant solution. This solved the ‘Red X” issue I was having with drive mapping to my UnRAID server’s shares.


  25. Daniel says:

    Nothing on this page is working for me. MapDrive.eve runs with no pop up but network drive is still disconnected.

  26. Blast says:

    Everything works perfect, Thanks

    With or without quotes is not really obvious, but with reading al the reply’s i have managed.
    Also logging in password protected Nas gives no problem (password is not in mapdrive settings, i think it takes the information out of the users/reference)

  27. Beer says:

    Thank you so much for this…. it actually works…. the only problem I am having is that I can not Hide icon and notifications for windows explorer. Every time i set it to do so it won’t save the settings. I go back to take a look and its back to “Show notifications”

    Is there a way around this?

    Thank you.

    Note: After using this program, you may still see the above balloon popup, simply click the spanner icon, and select ‘Hide icon and notifications’ for ‘Windows Explorer’.

  28. Mike says:

    Great little program, works for me. However I have the same problem as Beer, that annoying balloon popup refuses to be “hidden”. It insists on reverting back “Show Notifications”. Any ideas how to solve this?

  29. Thanks for this great tool – it is working perfectly for me.

    In case it helps anyone else, I can add a couple of extra tips which might be of use:

    – Annoying error balloon – I found this was still appearing on startup even though the drive was mapping successfully (thanks to the MapDrive tool). It would appear that this error was being displayed as a result of the native attempt by Windows to ‘reconnect at startup’ and so I manually disconnected the mapped drive thus removing this auto-reconnect attempt. Now MapDrive is the onle one left mapping the drive(s) and thus no error bubble is appearing.

    – Authentication – My SMB shares require authentication to connect and, as the MapDrive tool doesn’t provide for such, I found that I had to added my authentication credentials to the ‘Windows Credentials’ section of the ‘Credential Manager’ applet in Control Panel.

    Thanks again,


    • Beer says:


      Indeed after you manual Disconnect the drive… that balloon never appears again!
      And the mapped drive appears all the time!

      Good job!

  30. MKDel says:

    what a great little tool

    does exactly what it says on the can – well if you read about needing ” when you have spaces anywhere


    it’s actually made PureSync and my Synology NAS worthwhile and pain free

  31. Nana Sarah says:

    Thanks for a great little app that solves a silly problem that has bugged me for several years. Once I got done being blind about the spelling of my server and the argument syntax, it worked like a charm.

  32. Moley says:

    This tool is a great fix for a longstanding bug that should have been corrected by now.
    Thanks for it.
    Patton/Zorn/Bungle kickass

  33. BaDmO says:

    Windows 7 Home Premium w/SP1 (HP Pavilion Laptop) Wireless Network
    120GB SSD Drive boots lightning fast causing Mapped Drives to not connect.
    Solution: MapDrive.exe

    Okay, after reading ALL the posts with questions, concerns, confusion, solutions, repeated solutions, I have set up my Mapped NAS Drives with very little problems. The biggest problem I see for most here that can’t get it to work the first time is that there are quotes and spaces that need to be in the right places. (PAY CLOSE ATTENTION TO QUOTES AND SPACES)
    Here is what my 3 different shortcuts in my ‘Startup’ folder do for connections:

    Shortcut in my Startup Folder Named: ‘MapDrive X’
    “C:\Program Files (x86)\MapDrive.exe” X: “\\NAS_Drive\BaDmO Files” 5

    Shortcut in my Startup Folder Named: ‘MapDrive Y’
    “C:\Program Files (x86)\MapDrive.exe” Y: “\\NAS_Drive\Backups” 5

    Shortcut in my Startup Folder Named: ‘MapDrive Z’
    “C:\Program Files (x86)\MapDrive.exe” Z: “\\NAS_Drive\Downloads” 5

    I stored the MapDrive.exe in my ‘Program Files (x86)’ folder for ease of use. You can run it from any location of your choice. My NAS drive called ‘NAS_Drive’ would be whatever your Network drive name is and then use the backslash ‘your mapped’ drive name to complete the syntax.
    I tried a 20 sec delay but found that my computer would handle 5 seconds for the delay.

    Hope this another way to help somebody understand how I got mine to work. This might not be the exact solution for everybody. And if there are any mistakes in my comments, please feel free to reply with your own comments.

    • BaDmO says:

      And Thank you VERY MUCH ‘Zorn Software’ for this handy little app.

      I hope Microsoft will eventually fix this problem in future patches. Seems like such a simple fix or at least Zorn Software makes it seem that way. Thanks again.

  34. Doug says:


    Registry hacks, trying different things with the Credentials Manager, and another “fix” with the Group Policy Editor didn’t work. This did.

  35. Vincent says:

    Thank you so much for this, it’s the perfect solution when you use a NAS with XBMC (before I had to fricking click on the drives in the explorer to make them visibles to xmbc !)

  36. Patty from NY says:

    Dear Peter,

    Not only are you a very smart man, but you are very generous to share your fix with everyone. A million thanks go out to you!

    I have a mapped network drive that I was trying to do backups to using an automated program. But it would occasionally fail due to the drive not always being available. It took me awhile to realize that my PC was not connecting to the drive automatically on bootup and that was the source of the problem. In googling for an answer, I found out that this was a longtime problem with Windows going back through many generations of Windows operating systems. How could Microsoft allow this to go on so long? I thought surely they must have fixed this issue by now for those using newer versions of their OS, and that because I was still on XP I was not benefiting from their latest fixes. Then I saw that even those using Windows 7 were experiencing the issue! Shame on Microsoft for dragging their feet on this.

    At any rate, I used your fix and can confirm it is working just wonderfully on Windows XP Home SP3, with no apparent (so far) ill effects.

    You fixed this so simply, so why can’t Microsoft?

    Again, kudos to you and thanks a million!

    Patty from NY

    P.S. I tested various values at the end of the line — from 2 seconds to 25 seconds. All of them worked in getting the drive instantly connected on bootup. The main difference was that using the larger value actually booted up my system faster and more normally. The difference between using 25 seconds and 2 seconds was about a 20 second savings in bootup time. Moreover, I noticed that using the smaller values (2 to 10 seconds) resulted in a long delay between the time my desktop image showed up and the icons and desktop items did. It was just a blank desktop image for awhile. There was no such long delay using a value of 25. So that’s what I settled on. Others may want to use the larger values too, especially if they see some irregularities in the bootup process.

  37. Marius says:

    I ran into this same problem and fixed it by changing the following registry to a value of 1.


    Name: RestoreConnection
    Type: REG_DWORD
    Value: 1

  38. Jody says:

    Hello, great tool. But is there a command that can be used to rename the drives? I have 5 network drives but I have to manually name them otherwise they just say “Network Drive” which is really annoying. Sometimes when I manually rename them and restart, some of them retain the name but some dont. Its very strange. Thanks

  39. Jim C says:

    Well, after spending about 5 hrs trying various hacks – finally came across you site and a fix that works. JOY! This was really going to screw up my Mame machine, running Hyperspin and connecting to the Mame Roms stored on a NAS. The whole thing would have hung. Much, much appreciated….. If you don’t mind, I will copy a link to your site to a couple of the threads that got me nowhere….

  40. Arnie says:

    Mr. Bungle,

    With regard to the password protected share and your position “it’s not practical to add switches to allow username/password to be supplied on the command line, because then your password would be stored in plain text ”


    Payam’s reply “How about you leave it up to the administrators to decide how safe their environment should be rather than destroying an otherwise useful product? Not allowing input of a user-name/password requires to make the share unprotected which is even more of a security no-no than a plaintext password”,

    I have to agree with Payam. But I offer the workaround for those who are concerned like you with passwords in plain text. My workaround would be to write the .bat (batch) file with MapDrive and plain text passwords as needed, ie, /user: username password, and then use a number of free (and/or cheap) bat-to-exe programs. The batch file is now converted to an exe file and all content, including passwords, is no longer visible. I’ve used these converters when I needed to hide passwords, but more so didn’t want anyone to mess with the contents of the batch file. Once the bat is created and converted to exe – it is secure and no longer editable.

    I too need to connect mapped drives to password protected shares and the ability to do that and make use of your fantastic program would be ideal.

    Please reconsider your position and include a feature to toggle credentials.

    • admin says:

      Fair enough I see your point Arnie. I’ve updated the program to accept username and password now.

  41. Jimi says:

    Awesome, does what it says, simple and easy. Disconnecting the shared drives removes the pop up and everything still works perfectly.
    Thanks very much for your efforts and for sharing

  42. Paul Gilbert says:

    I could, you update the instructions to give details on how to use the new user name & password feature please. Sorry if I’ve missed this somewhere.


    • admin says:

      Screenshot of about dialog is updated now, you can pass username and password as two additional arguments e.g.

      MapDrive.exe s: \\server\share 20 myusername mypassword

      Apologies for the slow reply!

  43. My Cloud says:

    “d:\!Irni\FTP\wol\MapDrive.exe” F: “\\WDMYCLOUD\Downloads” 20 username password

    This syntax does nothing for me, no error message, no popup, just wait 20 seconds, and exit command prompt.

    this command works well, but your program does not:
    net use F: \\WDMYCLOUD\Downloads /USER:username password

Comments are closed.