How to Forget Samba (SMB) Credentials in Windows 11/10

Published by Nyau Wai Hoe - Updated on

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

How to Forget Samba (SMB) Credentials in Windows 11 10

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.

  1. Press Win + S to open the Windows search bar.
  2. Type in Credential Manager and click on the result to open it.Open Credential Manager in Windows 11
  3. Go to the Windows Credentials tab.
  4. Scroll down to find the credentials for the Samba or SMB share you want to remove.
  5. Click the downward arrow next to the credential details to see more.
  6. Click the Remove button next to the details, and confirm your choice when asked.Forget Samba SMB Credentials in Windows 11 10

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.

  1. Press Win + X and pick Windows Terminal (Admin). If your Windows 10 is older, you might see Command Prompt (Admin) instead.Open Windows Terminal Admin in Windows 11
  2. 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.Windows 11 10 clear SMB Samba credentials
  3. Find the network share you want to remove credentials for. It will be listed as \\ServerName\ShareName.
  4. 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.Remove Samba credentials command prompt Windows 11 10

    • For network shares linked to a drive letter, type the following command, swapping M: with your drive letter.
      net use M: /delete

      Deleting Samba network shared drive credentials CMD

  5. You might need to confirm the deletion. Type Y and hit Enter to continue.
  6. To check if the network connection is deleted, type net use again and make sure it’s gone.Windows 11 10 Remove SMB credentials CMD

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.”

Net Use Delete credentials 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.


Nyau Wai Hoe
Nyau Wai Hoe is the Founder and Chief Editor of WindowsDigitals.com. With a degree in software engineering and over 12 years of experience in the tech support industry, Nyau has established himself as an expert in the field, with a primary focus on the Microsoft Windows operating system. As a tech enthusiast, he loves exploring new technologies and leveraging them to solve real-life problems.

Share via
Copy link