In places where many devices are used together, sharing files and resources between computers is usually necessary. A popular method is using Samba (SMB) network shares. But sometimes, you might need to remove or forget your Samba or SMB credentials on your Windows 11 or 10 PC. This can be because you just want to keep things slightly more secure or to fix issues with connecting. This guide will show you how to do this safely, and also gives an alternative way using Command Prompt.
Also see: How to Update Network Drive Login Credentials in Windows 11
Page Contents
Forget Samba (SMB) credentials using Windows Credential Manager
Forgetting your stored Samba or SMB credentials can be easily done through the Windows Credential Manager. This tool lets you handle different types of credentials, including those for network file sharing. The following steps will show you how to do it for both Windows 11 and Windows 10.
- Press Win + S to open the Windows search bar.
- Type in Credential Manager and click on the result to open it.
- Go to the Windows Credentials tab.
- Scroll down to find the credentials for the Samba or SMB share you want to remove.
- Click the downward arrow next to the credential details to see more.
- Click the Remove button next to the details, and confirm your choice when asked.
This method makes sure the credentials are removed from your system, stopping automatic logins to those network shares later.
Pro tip: How to Share Folder in Windows 11/10 Without Password
Remove Samba (SMB) credentials using Command Prompt
If you’re good with command-line tools or need to write a script to remove credentials, using Command Prompt is another way. This method will use the net use
command, which is also pretty useful for network troubleshooting and some management.
- Press Win + X and pick Windows Terminal (Admin). If your Windows 10 is older, you might see Command Prompt (Admin) instead.
- First, it’s helpful to see all active network connections. Type
net use
and hit Enter. This shows all active network connections, including those using SMB or Samba. - Find the network share you want to remove credentials for. It will be listed as
\\ServerName\ShareName
. - Delete the network credentials:
- For network shares shown by server and share name, type the following command and hit Enter.
net use \\ServerName\ShareName /delete
Replace
\\ServerName\ShareName
with the real network share name you found earlier. - For network shares linked to a drive letter, type the following command, swapping
M:
with your drive letter.net use M: /delete
- For network shares shown by server and share name, type the following command and hit Enter.
- You might need to confirm the deletion. Type
Y
and hit Enter to continue. - To check if the network connection is deleted, type
net use
again and make sure it’s gone.
These commands will generally help you to manually remove the network share connection and clear the associated credentials. This is useful if you prefer using command lines for such tasks.
Linked issue: The Specified Network Password is Not Correct (Fix)
Some common issues you might encounter
Even if you follow the suggested methods, there are a few problems that you can run into while trying to remove or forget Samba (SMB) credentials in Windows 11 or 10.
Credentials persist after removal
Even after deleting credentials through either the Credential Manager or Command Prompt, you’re still able to connect to the network share without re-entering credentials.
Solution: Try restarting your computer to apply the changes. Windows sometimes caches credentials temporarily, and a reboot can clear that cache.
Related resource: Disable Network Level Authentication in Windows 11 or 10
Command Prompt returns an error
When using the net use
command to delete credentials, you encounter an error message like “System error 85 has occurred” or “The network connection could not be found.”
Solution: Make sure you are using the right format and spelling for the network share name (\\ServerName\ShareName
). Also, confirm you’re running Command Prompt as an administrator.
Credential Manager doesn’t show the network share
You’ve gone to the Windows Credentials tab in the Credential Manager, but the network share you want to remove credentials for isn’t there.
Solution: It might be because the credentials are in a different section like “Generic Credentials,” or linked to a specific app. Look carefully through all sections to find them.
Access denied after removing credentials
After successfully removing the credentials, you can’t reconnect to the network share and get an “Access Denied” message.
Solution: You may need to reconnect by entering new credentials. Go to the network share like usual, and when asked, type in the new username and password.