Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

While troubleshooting a Samba vs Windows Network issue, I noticed that Windows' Explorer remembers login credentials of remote shares, even if you ask it not to. For instance, after accessing a share using \\servername\sharename plus entering username/password and then closing Windows Explorer, adding the same share as a network drive gives the following message, regardless whether the username is the same or not:

The network folder specified is currently mapped using a different user name and password.

To connect using a different user name and password, first disconnect any existing mappings to this network share.

Using NET USE does not show the share. After restarting the computer, I have no problems accessing the share using different credentials. But restarting just for testing other credentials is annoying, esp. while troubleshooting. How can I purge this cache, using Windows Vista?

Note: using nbtstat -R[R], ipconfig /renew, killing explorer.exe or disabling / re-enabling the network card didn't help.

share|improve this question
add comment

4 Answers

up vote 3 down vote accepted

The following advice does not help you to 'purge or empty Windows Explorer’s network username and sharename cache' (as you asked). But it will allow you to connect to (essentially) the same share or the same server using a different username.

The trick is to use the IP address of the remote server.

(Also,

if it's Samba on the remote side,

  • you could setup smb.conf to contain netbios aliases = firstname, secondname, thirdname and you'll have even more options

if it's a Windows AD member server on the remote side,

  • you could create a different 'Domain Name Alias' for your server,

and you'll have even more options. In all these situations, the connecting client will behave as if it connected to a different server.)

share|improve this answer
    
Excellent suggestion, thanks! –  Abel Aug 1 '10 at 8:31
add comment

Logging out and logging back in will clear the credentials.

You can also try restarting the "Computer Browser" service. That seems to force some type of refresh (although it may take a few seconds to take effect).

share|improve this answer
    
As an IT Professional, I have never heard of the Computer Browser service until just now, so I Googled it. You might consider including instructions on HOW to clear the Computer Browser service. However, please also bear in mind that this question was asked two years ago, and already has an accepted answer. –  David W Oct 19 '12 at 0:10
    
Restarting vs logging in and out is still a big nuisance just for testing a network share. I know the computer browser service, but I don't know what the ramifications are when I restart it, plus many other services depend on it, so I need to restart them to. But it might be a workable workaround for this annoying Windows issue. –  Abel Oct 19 '12 at 7:02
add comment

For Vista go to Start and type in:

Control keymgr.dll

in the little box at the bottom and hit enter. This will bring up the Stored User Name and Passwords box. You can then edit, add, or remove network passwords.

share|improve this answer
    
Same answer as 2 hours before from Ossan Sokiv (but I wasn't aware of the Control call). The usernames / passwords of the network neighborhood are not part of this list, unfortunately. –  Abel May 15 '10 at 12:07
add comment

Are the shares listed in %userprofile%\nethood ?

Also, have you tried opening the Control Panel, selecting User Accounts, gone to the Advanced tab, and clicked "Manage Passwords" to see if you can clear it out from there?

/edit - this is on my machine which is XP, not sure if Vista is exactly the same.

share|improve this answer
    
Even if I run as Administrator, I get "Access denied" for Nethood. Not sure how to view its contents. –  Abel May 15 '10 at 12:09
    
OK: in Vista this is a shortcut. A problem with Vista is that all default shortcuts under %userprofile% have incorrect rights ("Everyone" has no rights, which causes "Access denied" even if you're an admin). One of the wonders of Vista: you can't even access My Documents this way. Changing the rights on the link (removing "Everyone") solves the issue. Unfortunately, the list under Nethood is empty. –  Abel May 15 '10 at 12:12
    
@Abel: Actually, the shortcut is a Junction link. They are protected because they are there for backward compatibility. And older programs not Junction aware can possibly delete the folder target and not the link itself. –  surfasb Oct 31 '11 at 5:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.