How to Access Samba Share from Windows [2 Methods]

If you are searching for a compatible and open source software for accessing and sharing files, folders and other data, then come across the Samba share. It provides a cross-platform adaptable environment between Windows and other systems. In this tutorial, I have outlined every ins and outs on how to access Samba share from Windows. So, go over it, try accessing Samba share from your Windows and leverage the benefits of this interoperable service.

Key Takeaways

  • Learning basic commands of the command prompt, PowerShell.
  • Understanding the fact of accessing Samba shares from Windows.
  • Learning how to connect and disconnect Samba drives.

Requirements

  • Users must have Samba already installed and configured properly.
  • Users must have Samba connection on.

Process Flow Chart

[Windows Used Throughout the Tutorial: Windows 10]Flowchart-How to access Samba share from Windows

2 Methods on How to Access Samba Share from Windows

You can easily access samba share from Windows only employing some compact and effortless steps. Here, I am going to introduce two types of methods that will help you to access the Samba share.

You can read the Comparative Analysis of Methods to know more related terms regarding samba shares.

Method 01: Accessing Samba Share from Windows Using GUI

In the following section, I will show two cases of GUI (Graphical User Interface) for accessing Samba share from Windows.

A. Accessing Samba Share Using File Explorer

To access Samba share using File Explorer follow the manual procedure shown below:

Steps to Follow >

➊ Press WIN+E or you can click on the Folder icon like the image below to open file explorer:Clicking on folder icon to open file explorer❷ Enter the path of the Samba share in the address bar like the format below and click ENTER:

\\192.168.231.128\sambashare
EXPLANATION
  • \\192.168.231.128: Represents Samba server IP address.
  • \sambashare: Indicates the shared folder.

Here, ‘192.168.231.128’ is my system’s IP address and ‘sambashare’ is the folder I want to share.

❸ Now, enter your network credentials when prompted to you and click OK.Entering credentials ❹ Once done with the connection, you can access all the shared files and folders inside the shared one.Accessing folders from Samba share using file explorer Following the above steps, I can access the new_samba folder inside the Samba share.

B. Accessing Samba Share Using Map Network Drive on Windows 10

Map Network Drive is another way of accessing Samba share. Follow the steps to exercise it:

Steps to Follow >

➊ Go to file explorer and click on Map network drive under the Computer tab like the following image:clicking on 'Map network drive'❷ Now, choose a Drive, enter the path for the Samba share and click Finish.Choosing a drive and path for Samba share From the image, you can see that I have chosen drive B: for my desired Samba share.

❸ If there prompts the credential requirements, then provide your user name and Samba password.Entering credentials to accessAfter this, you can see that the Samba shared folder has been mapped to the selected drive.New Samba share drive created❹ Now, double click on the new drive and you can access the files and folders inside the Samba share.Accessing Samba share from mapped-driveFrom the snapshot above, you can see that I can access my new_samba folder inside sambashare.

Read More: Install, Configure and Connect Samba on Ubuntu Using GUI

Method 02: Accessing Samba Share from Windows Using Command Line Shell

Below I will demonstrate two different cases of ‘Command line shell’ for accessing Samba share from Windows.

A. Accessing Samba Share Using Command Prompt

To access the Samba shares’ contents from the command prompt follow the steps below:

Steps to Follow >

➊ Press WIN+R, type cmd and hit ENTER. You will prompt to the command line interface.

❷ Now, write the following command in the command prompt to connect to the Samba share:

net use P: \\192.168.231.128\sambashare /user:nadiba 1234
EXPLANATION
  • net use: Manages network connectivity.
  • P: Indicates the assigned drive letter for the Samba share. I have chosen ‘P’ drive.
  • \\192.168.231.128\sambashare: Represents Samba server IP address and the shared folder.
  • /user:nadiba: Specifies the Samba username. ‘nadiba’ is my Samba username.
  • 1234: Represents Samba user password. Here, my system’s Samba user password is ‘1234’.
Writing command in command prompt to access Samba shareIf the given credentials are correct, you will see ‘The command completed successfully.’ like the above image.

❸ You will find then that the Samba share has been mapped to the assigned drive letter like the following image:New Samba drive created using command promptThus, you can access the samba shares’ contents.

B. Accessing Samba Share Using PowerShell

You can also access Samba shares from PowerShell by following the given steps:

Steps to Follow >

➊ First, open PowerShell and write the following command to create a new drive:

New-PSDrive -Name A -PSProvider FileSystem -Root \\192.168.231.128\sambashare -Credential (Get-Credential)
EXPLANATION
  • New-PSDrive: Creates a new PowerShell drive.
  • -Name A: Represents the letter of the drive you want to assign. I have preferred ‘A’ for my drive.
  • -PSProvider FileSystem: Filesystem provider is used for the new drive.
  • -Root \\192.168.231.128\sambashare: Specifies the path location of the Samba share.
  • -Credential: The requirements to access the Samba share.
  • (Get-Credential): Prompts you to provide the username and password to access Samba share.
Writing command in PowerShell to access Samba share ❷ Now, you will prompt to a new window to provide the Samba username and password. Provide the requirements and click OK.Inserting PowerShell credentialsYou can see in the following screenshot that the Samba share has been mapped to the specific drive you chose.New drive created using PowerShell❸ Now, you can navigate to the drive whenever you want by running the command below:
cd A:
EXPLANATION
  • cd A: Navigates to the drive A.
Navigating to new Samba drive using PowerShellAfter navigating to the new Samba drive you can interact with the contents in the Samba share.

Read More: How to Install, Configure and Connect Samba Client on Ubuntu

Comparative Analysis of Methods

While accessing Samba share from Windows, you have two options- using GUI or command line shell. Let’s make a comparative analysis between these two methods.

Methods Pros Cons
Method 1
  • User-friendly interface.
  • No syntax complexity.
  • Instant visual feedback.
  • Lacks advanced automation.
  • Limited custom options.
Method 2
  • Faster.
  • Automation utility.
  • More advanced options.
  • Requires proficient users.
  • Less visual response.

Overall, both methods are preferable with their individual specifications. Which method to choose totally depends on the user’s preference, experience level and individual perspective.

Complementary Information

Besides the previous discussion regarding access to Samba share, the below information might interest you.

How to Open PowerShell

There are several ways to open PowerShell in Windows. I have mentioned three easy processes below:

1. Open PowerShell Using File Explorer

Press WIN+E and type powershell in the address bar and tap ENTER.

2. Open PowerShell Using Run Dialog

Press WIN+R, write powershell and click OK.

3. Open PowerShell Using Start Menu

Click on the Start menu at the bottom-left of the screen, scroll and expand the Windows PowerShell folder and then click on ‘Windows PowerShell’ option.Prompting to PowerShell windowAll of these three processes will open the PowerShell application in your Windows like the above image.

How to Perform Several Tasks on Samba Drive Using PowerShell

Using PowerShell you can view the listed contents, add new items or remove the whole Samba drive. Follow the detailed execution mentioned below:

List Contents

After navigating to the assigned Samba drive, you can list all the contents inside the Samba share using the command below:

Get-ChildItem
EXPLANATION
  • Get-ChildItem: Returns collection of contents within the shared path.
Seeing the content list inside Samba share using PowerShellYou can see from the image that I have navigated to drive A and can see the new_samba folder inside sambashare folder.

Create New Items

To create new files in a mounted Samba drive use the command below:

New-Item -ItemType File -Path A:\new_samba\samba.txt
EXPLANATION
  • New-Item: Creates new item.
  • -ItemType File: Specifies the item’s type as file.
  • -Path A:\new_samba\samba.txt: Indicates the location of the new file. I have created ‘samba.txt’ as a new file inside ‘A’ drive.
Creating new files in a mounted Samba drive using PowerShellYou can see a new file ‘samba.txt’ has been added to the new_samba folder inside Samba drive.

Remove Drive Mapping

Once done accessing Samba share, you can remove the mapped Samba drive using the following command:

Remove-PSDrive -Name A
EXPLANATION
  • Remove-PSDrive: Removes the assigned drive.
  • -Name A: Represents the letter of the drive you want to assign. I have preferred ‘A’ for my drive.

Also, you can check if the drive has successfully been removed or not by running the syntax below:

Get-PSDrive -Name A
EXPLANATION
  • Get-PSDrive: Displays information about the given drive.
  • -Name A: Represents the letter of the drive you want to assign.
Removing mapped Samba drive using PowerShellFrom the above image, it is clear that the drive ‘A’ is removed successfully.

Conclusion

Samba share integrates collaboration in mixed operating systems. So, to confirm seamless access to Samba share from Windows you must configure the Samba server and set permissions properly. Also, ensure that Windows and Linux machines are on the same network.

People Also Ask

Can I install Samba on Windows?
Yes, you can install Samba on Windows because it’s free and open-source software.

How to see SMB shares in CMD?
To view SMB shares click on the search box, then type cmd and press ENTER. At the prompt, write net share and hit ENTER.

How to find out my SMB IP Address?
Open the command prompt and type ipconfig and hit ENTER.

Do all Windows share use SMB file sharing protocol?
Yes, all Windows shares use SMB.

Can I block SMB traffic using Windows firewall?
You can block all inbound SMB traffic using Windows firewall configuration.

What is the security risk of SMB in Windows 10?
The SMB vulnerability lets an unauthenticated attacker execute any code as an application.

Related Articles 

Rate this post
Nadiba Rahman

Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor’s degree in Electronics & Telecommunication Engineering from Rajshahi University of Engineering & Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio

Leave a Comment