How To: Force Windows to Forget a Network Share Password

When you connect to a NAS in Windows, it will often helpfully remember the username and password of the NAS account it got access through. Forever. So, if you want to log into the NAS as a different user, well – tough. Windows already has a working set of credentials, and by jingo it’s gonna use them. The fix? From the command prompt, enter:

This will get rid of all connected share credentials, however you may want to just get rid of the credentials for a specific share. If so, you can use:

For example, the get rid of the credentials for the “Code” share on my NAS:

Now, to map the share to a drive and give it the credentials YOU want Windows to use, go with:

So, if I wanted to map the Code share of my NAS to the Z: drive, and access it with a user called bob who has a password MyClevahPass123, I’d use:

Done & dusted.

Please Note: The credentials you supply must be the username/password of the user the SHARE knows to grant access to, not just your own Windows username/password. Just clarifying =D

4 thoughts on “How To: Force Windows to Forget a Network Share Password”

  1. Thanks, this helped me setting up my FreeNAS.
    I have guest account enabled for some shares, other shares are private, but since windows stored the guest credentials I wasn’t able to login to the private ones, permission denied. This solved it :-)

  2. Hey.
    Looks great, exactly what I want. But doesn’t work for me
    I’m on a laptop running windows 7, wirelessly connected to a WAP, which is connected to a router, to which are connected other computers. No central server – small home network.
    Windows 7 explorer can see the target computer (\\HEN) but i tried logging in once and stupidly ticked remember credentials, not it wont let me in and I can’t change them. Think it doesn’t like my password on the networked computer being blank.
    But typing your commands into the prompt returns a message “The network connection could not be found. More help is available by typing NET HELPMSG 2250.” typing that simply returns the same message but without the “more help available” part.
    Doesnt matter if I start from C\Windows or C\James. Would I need to be in CMD as an admin? don’t really want to do that.

    Any ideas?

    Thanks,

    James

    1. That’s a nuisance. It looks like you can fix this up via the registry though (using regedit) – I don’t know how comfortable you are hacking around in the registry, but as long as backup the registry first and only change/delete the specified keys you should be fine:

      Option 1

      I had the same problem on a couple of my machines. Here is how I fixed my computer:

      I went into the registry and looked under:
      HKEY_USERS\..\Software\Microsoft\Windows NT\CurrentVersion\Network\Persistent Connections
      for each user listed. In one of the users, it had a key named Save Settings. The value of this key was NO. I deleted the key and rebooted my machine.

      My login script ran fine this time and the “Disconnected Network Drive” disappeared and I was able to map a new drive to that drive letter.

      Hope this helps.

      Dale

      Source: http://www.pcreview.co.uk/forums/disconnected-network-drives-t1871516.html

      Option 2

      First and foremost, back up your registry!! Then open regedit and search for Mountpoint key in the \HKEY_CURRENT_USER\Software\Microsoft\windows\CurrentVersion\Explorer folder find the share you need removed and delete it.

      Source: http://www.tomshardware.com/forum/53427-45-remove-network-drive

      Hope this helps.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">