• NetUse Mapped Drives Disappear with Reboot

    Home » Forums » AskWoody support » Windows » Windows 10 » Questions: Win10 » NetUse Mapped Drives Disappear with Reboot

    Author
    Topic
    #508139

    When I am working at home, I need to have two drives mapped that mimic the server drive mappings I have when I’m in the office. To do this, I created two directory that correspond to the two server drives and I use a batch file to map them as follows.

    net use h: \localhostc$ServerDriveHDrive /persistent:yes
    net use s: \localhostc$ServerDriveSDrive /persistent:yes

    This has worked on the past two computers I have had with XP and Win7. The drives still map with Win10, but they are not persistent. When I reboot the computer, they are gone and I have to run the CMD file again to map them.

    Anyone know what has changed in Win10 that’s keeping this from sticking?

    Viewing 8 reply threads
    Author
    Replies
    • #1590578

      Have you made the folders Hdrive and Sdrive shareable?
      Then all you would need would be
      net use H: \pcnameHdrive /p:y
      net use S: \pcnameSdrive /p:y

      BATcher

      Plethora means a lot to me.

      • #1590579

        Have you made the folders Hdrive and Sdrive shareable?

        This is on the local drive, not a remote drive, so they are shareable. And, as I said, the mappings do work until I reboot and then they get lost.

    • #1590601

      Perhaps I should have worded my reply slightly differently!
      Do they appear on net share ?
      What do you get with
      net share Hdrive
      and
      net share Sdrive

      BATcher

      Plethora means a lot to me.

      • #1590602

        Perhaps I should have worded my reply slightly differently!

        Still not sure I follow. The drive is the local c$ which is the default share so the directories under it are shareable. Besides, if it were a sharing problem, then it wouldn’t work at all, which isn’t the case.

        This is something in Win10 that’s different than it was in Win7 since the same thing works fine there.

    • #1590614

      NET SHARE

      Code:
      Share name   Resource                        Remark
      -------------------------------------------------------------------
      ADMIN$       C:WINDOWS                      Remote Admin                      
      T$           T:                             Default share                     
      C$           C:                             Default share                     
      D$           D:                             Default share                     
      E$           E:                             Default share                     
      IPC$                                         Remote IPC                        
      print$       C:Windowssystem32spooldrivers
                                                   Printer Drivers                   
      V$           V:                             Default share                     
      Backup       D:Backup                       
      Users        C:Users                        
      The command completed successfully.

      Note my share Backup…

      BATcher

      Plethora means a lot to me.

      • #1590621

        Backup D:Backup

        I really do understand. What I’m trying to get across is that if what I was doing was a problem, it wouldn’t work at all. But that’s not the case.

        This exact same thing works just fine in XP and Win7 and Win10 – until I reboot. For some reason, it either isn’t remembering the drive mappings or there is some kind of sequencing problem at boot time. It might be similar to the problem Win10 seems to have that results in server drives initially showing up as unavailable until you access them.

        I’m considering getting rid of the persistent flag and putting these mappings in a login file just to see if that solves the problem.

    • #1590678

      I can’t really help further (even if I did already) if you haven’t tried my suggestion for
      net use x: \pcnamesharename /p:y
      because I don’t have any problem with drive mappings, in Win 7 or Win 10.

      Don’t know if any of these links will be of any use…
      https://community.spiceworks.com/topic/1139165-windows-10-losing-mapped-drives

      https://community.spiceworks.com/topic/1477937-automatic-reconnecting-mapped-drives-in-windows-10

      http://stackoverflow.com/questions/182750/map-a-network-drive-to-be-used-by-a-service/4763324#4763324

      BATcher

      Plethora means a lot to me.

      • #1590682

        I can’t really help further

        If I were unable to create the drive letters, then what you are suggesting would be helpful. In fact, before I knew about using the default share of \localhostc$, your suggestion is the way I used to do things.

        Perhaps it’s worth going back to that just to see what happens, but what I am doing does work. The drive mappings are in place right now and have been in place for three days because that’s the last time I rebooted. It’s just that something odd is happening when I reboot and those mappings don’t take place.

    • #1590690

      As a matter of interest, using Win 10 Home AU (Version 1607 Build 14393.693) in a VM, I created similar folders (without setting them up as ‘shares’) then mapped to them using the same BAT file:

      46647-map_drives
      Click to enlarge

      I’ve shutdown/restarted several times and can confirm that the drive mappings persist.

      I use a local account (the first one created, so is automatically in the Administrators group), not a Microsoft Account. Could this perhaps be different?

      • #1590692

        I use a local account (the first one created, so is automatically in the Administrators group), not a Microsoft Account. Could this perhaps be different?

        I’m also using a local account and this is Win10Pro.

        Just out of curiosity, I created a logon script with the drive mappings. When I reboot and look in Windows Explorer, the drive mappings aren’t there. But if I check at the command prompt, they are there. And when I use a third party tools such as Total Commander, they show up but give an error when I first try and access them. They aren’t red X’d out but they haven’t connected completely either.

        There is something weird happening in the sequence of events. It’s not the first time I’ve run into this with Windows.

    • #1590694

      Perhaps the drives are being automatically disconnected*after a period of inactivity before shutting*down the PC.

      Have you checked or changed the automatic disconnect time? You should be able to use net config server /autodisconnect:-1 to never disconnect.

      --Joe

    • #1590696

      When you map a drive with persistence it creates a registry entry in HKEY_CURRENT_USERNetwork.

      46648-map_drives_registry
      Click to enlarge

      Have you checked that the account you use has Full Control in Permissions?

      Alternatively, copy/paste the following into Notepad, save as something like map_drives_with persistence.reg:

      Code:
      Windows Registry Editor Version 5.00
      
      [HKEY_CURRENT_USERNetwork]
      
      [HKEY_CURRENT_USERNetworkh]
      “RemotePath”=”\\localhost\c$\ServerDrive\HDrive”
      “UserName”=dword:00000000
      “ProviderName”=”Microsoft Windows Network”
      “ProviderType”=dword:00020000
      “ConnectionType”=dword:00000001
      “DeferFlags”=dword:00000004
      
      [HKEY_CURRENT_USERNetworks]
      “RemotePath”=”\\localhost\c$\ServerDrive\SDrive”
      “UserName”=dword:00000000
      “ProviderName”=”Microsoft Windows Network”
      “ProviderType”=dword:00020000
      “ConnectionType”=dword:00000001
      “DeferFlags”=dword:00000004
      

      Double-click on the newly-created REG file and try to merge it. If the merge fails then something is stopping it, most likely permissions but could be security software (AV, 3rd-party firewall, etc.).

      Hope this helps…

    • #1590701

      I am the primary user with full administrative rights. But, again, if it were a rights issue then I should be having trouble creating the drive map in the first place.

    • #1590707

      You have to remember that even though you are a member of the Administrator group that is NOT the same as it used to be. You do not have unfettered access to the system.*You may not have permissions to modify*objects*that are owned by other accounts. That is one reason “Run as Administrator” is available.

      See if any of the*links at windows 10 mapped drives administrator token apply to your situation.

      --Joe

    Viewing 8 reply threads
    Reply To: NetUse Mapped Drives Disappear with Reboot

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: