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]
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.
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.
The 'net use /PERSISTENT:NO' command seems like it relates to this issue. But I couldn't get it to have any impact.
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).
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.
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.