5

I want to be able to connect from Windows 7 Explorer to SMB shares on different systems, using different credentials at different times.

How do you make Explorer offer a prompt to use different credentials? It seems if it knows credentials for a network share path, it uses them.

Or the opposite -- if it knows some credentials for that server, but you select a share that those creds don't have privileges for, then Explorer just says "you do not have permission".

And "Disconnect Drive" doesn't seem to apply here -- for one thing, network drives don't show up on that list unless mapped. And if they are mapped you can disconnect them, but when you browse back to them... Explorer uses the credentials it's remembered and logs right in with no prompt.

[Edit to add more details]

  1. I can use net use to delete everything from the list it uses (so 'net use' shows empty)... but Explorer still logs right back on using the same credentials. In one case that puts an item back on the net use list, for another share it does not. Either way, still can't change to different credentials.

  2. Part of the confusion when trying different approaches is probably this: https://blogs.msdn.microsoft.com/oldnewthing/20110223-00/?p=11413 which describes that there's a disconnect grace period of ten minutes. So 'net use * /d' doesn't take effect immediately.

  3. The 'net use /PERSISTENT:NO' command seems like it relates to this issue. But I couldn't get it to have any impact.

  4. Something that DOES work is killing the Workstation service, and then restarting it. At that point, attempting in Explorer to browse to previously-connected shares results in Explorer putting up a user/pwd dialog. Yay. But what a blunt instrument to get there. I'll also record for others who stumble in here that, for me, attempting to stop Workstation would hang in the "Stopping" state. I later discovered this occurs if (a) some Explorer window is browsing a share, or (b) I happen to have VPN software running (in my case NetExtender).

  5. I found this: Disconnecting / logging out from Windows network share without restarting Workstation service , in which the OP and others go through much of the same thought process... to no avail.

  6. This too might relate in some way: http://www.gadgetgrill.com.au/2009/11/19/windows-7-fixing-the-mapped-drive-credentials-problem/

So, problem not really solved -- I want to be able to gracefully switch a share to different credentials without having to clobber the VPN all other connections.

4
  • 1
    @gwidman in cmd try to remove the network connection with net use i.e. net use \\server\sharename /d or to delete all network connections net use * /d /y
    – Zalmy
    Jun 16, 2016 at 13:13
  • 1
    I can use net use to delete everything from the list it uses (so 'net use' shows empty)... but Explorer still logs right back on using the same credentials. In one case that puts an item back on the net use list, for another share it does not. Either way, still can't change to different credentials.
    – gwideman
    Jun 16, 2016 at 13:43
  • For me, net use worked to override the obsolete credentials, but I found no way to actually delete the old credentials.
    – Jan Hudec
    Aug 24, 2017 at 10:32
  • How did you get it to remember the credentials in the first place?
    – wanwandrew
    Apr 14, 2022 at 18:00

4 Answers 4

5

Go to the Credential manager in your control panel (in user accounts and family safety)

Click in Windows Credentials and Select the credentials, delete what you need

Try to login en yours SMBs shares (if you delete correctly the credentials, windows ask you for user & password) and dont forget to uncheck Remenber my credentials

7
  • 2
    Thanks, but the credentials for the drives in question aren't appearing in Credential Manager.
    – gwideman
    Jun 16, 2016 at 13:37
  • Try in control panel -- User Acounts -- Manage Credentials . Sometimes Windows save the credentials in User Profile ;)
    – Wendigo
    Jun 16, 2016 at 13:48
  • Control Panel > User Accounts > Manage your credentials just brings up Credential Manager, same as before. Or did you mean something else?
    – gwideman
    Jun 16, 2016 at 14:19
  • No, i mean exactly this :(
    – Wendigo
    Jun 16, 2016 at 14:29
  • The credential manager has everything else (Exchange, TFS etc.), but does not seem to have the network shares.
    – Jan Hudec
    Aug 24, 2017 at 10:29
5

In windows command prompt you can use the following the list the remembered credentials:

net use

The output will be similar to:

New connections will be remembered.


Status       Local     Remote                    Network

-------------------------------------------------------------------------------
OK                     \\123.123.123.123\shared      Microsoft Windows Network
The command completed successfully.

Then you can use the following command to delete the credentials:

net use <path> /delete

For the example above it would be:

net use \\123.123.123.123\shared /delete

UPDATE: Remember to close the explorer window and open a new one after this

2
  • You may notice in my original post that your suggestion is item number 1 on the list of things that I tried that did not work.
    – gwideman
    Apr 5, 2018 at 15:12
  • Same, removed entries with net use. No more entries exist. Yet I can still access the SMB share. No credentials exist in credential manager either... Apr 2, 2020 at 19:12
1

For anyone still having this problem, I discovered something that worked for me: When in the Credential Manager and it does not have a credential for your server, add one with a bogus login (but the correct address). This made the Add Network Location GUI prompt me for a new login. Hope this helps.

1
  • 1
    Thanks for this contribution. I'll have to try this next time I encounter this problem.
    – gwideman
    Jul 24, 2020 at 22:25
0

The net use /delete (run as administrator) does not make explorer forget, because it is the wrong user. If you use it without the run as administrator, it does the job, but you may need to close all explorer sessions first. I actually killed explorer using task manager.

You then may have to use task manager to start a new task - explorer - to get it back again. Then run the net use - for my example I use:

net use /delete \\nas

Where my server is just called NAS. Then, if I try connecting to it again, I get asked for my password. The purpose of this is to protect the network drive if my PC gets hacked. I don't want the hackers having access to my network drive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .