Working With Shared Folders in Windows 7

Before you start

Objectives: learn how to configure basic sharing, advanced sharing, how to access shared folders using UNC, and which command line utility can be used to configure shares.

Prerequisites: you have to know what are NTFS and Share permissions in Windows. and how to configure NTFS permissions in Windows 7.

Key terms: shared folders, network share, advanced sharing, basic sharing, net share command.


 Shared Folders

As you know, in Windows 7 we can set up Shared Folders in three different ways: Basic, Advanced and Public folder sharing. We will now see how that works. For the purpose of this article we will create a folder named “demo” on our Desktop. Next, we will right click it, select its Properties, and then open the Sharing tab.

 1 Sharing tab

Sharing Tab

Notice that we can see two Sharing sections on this tab. The first section is named Network File and Folder sharing. Here we have a Share button which will take us to the Basic sharing options. On the Advanced Sharing section we can click on the Advanced Sharing button which will take us to advanced options.

Basic Sharing

To edit Basic sharing options we simply click on the Share button in the first section.

 9 Basic Sharing

Basic Sharing

 This interface is a bit simpler than in Advanced Sharing. Here we can choose the users and groups and then add them to the list. When we click Add, we can then change Permission Level by choosing appropriate permission from the list.

 10 Basic Permissions

Basic Permissions

Notice that we can only give Read and Read/Write permissions. Owner permission is set for the user who created the share.

When we click the Share button, we will get a UNC path to the shared folder which we can then copy and send to other users. They will have to enter the whole path to access our shared folder.

 11 Share Link

Share Path

To stop sharing folder in this Basic configuration, simply right-click shared folder, select the “Share with” option, and then select “Nobody”.

Right-Click Sharing

We can also share any folder by right-clicking it and then selecting the “Share with” option.

 8 Share With

Share With option

This way we can share folder directly to a HomeGroup with Read or Read/Write permissions. We can also choose the “Specific people” option which will take us to the Basic Sharing screen that we already saw above.

Advanced Sharing

Advanced Sharing is the original way of sharing things in Windows and administrators will almost always want to use this method of sharing.

Let’s click on the Advanced Sharing button. We will enter the “demoshare” as our share name (the share name can be different from the name of the folder).

2 Advanced Sharing 1

Advanced Sharing

Notice that here we can limit the number of simultaneous users here, and that we can edit permissions and caching options. Let’s check out Permissions by clicking on the permissions button.

 3 Permissions

Permissions

Notice that the Everyone group by default has Read permission on shared folders. Here we can now add other users or groups and set their Share permissions.

Let’s click on the OK buttons and check our shared folder in Windows Explorer. To do that we will enter the UNC path to our share. Our computer name is WIN-7-VM and we know that the share name is “demoshare”. The UNC path syntax is \\computername\sharename. So, the UNC path to our share is \\WIN-7-VM\demoshare. To check your computer name you can go to System properties (right-click your computer icon and select Properties option). Let’s enter the UNC path to our WIN-7-VM computer to see all shared folders.

 4 Shares

Shares

Note that we can see our demoshare folder and the Users folder. We see the Users folder because this is where the Public folder is located. Now, what if we want to share some folder but we don’t want it to be visible to all users? To do that we can use Administrative Share. To configure administrative share, we simply put the $ sign after the share name. For example, let’s add another share name to the same folder but this time with the $ at the end. The added share name will be “demoadmin$”. To add another share name, we simply click on the Add button on Advanced Sharing window. When we Add new share, we will get a new window to enter options.

 5 Add Share

Add Share

When we click OK, the “demoadmin$” will be added to the list of share names.

 6 Share Names

Share Name List

Let’s now check the \\WIN-7-VM.

7 UNC Path

Shared Folders

Notice that the “demoadmin$” is not listed, and that’s great. We can still access that share by entering the whole UNC path manually: \\WIN-7-VM\demoadmin$.

Now, remember that share permissions and NTFS permissions work together. The most restrictive permission is the effective permission. Administrators sometimes give Full control to Everyone group in share permissions, and then manage user permissions using NTFS permissions. This way administrators manage permissions from one location.

File Sharing Wizard

We can also create shares using File Sharing Wizard in Computer Management console (right-click Computer icon and select Manage option). In Computer Management we will navigate to the Shared Folders. Here we can see all shares that are configured, active sessions and open files. Here we will see all folders that are configured using the Advanced configuration that we described earlier. Here we can also add new shares. To do that simply right-click and select New Share, and then follow the wizard.

Shares in Command Line

In command line we can use the net share command to work with shares. Remember, we first have to run CMD as administrator (right-click > Run as administrator). To list all configured shares we can simply enter net share  command.

Let’s say that we want to share a folder located in C:\Docs. The share name will be “docs”. We will give Kim Verson read permission on that share. The whole command to do all that would be net share docs=c:\Docs /grant:”Kim Verson”,READ

 15 Net Share CMD

Net Share command

To delete that share we can enter the command net share docs /delete. For the full syntax of the net share command enter net share /?.