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.
Key terms: shared folders, network share, advanced sharing, basic sharing, net share command.
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.
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.
To edit Basic sharing options we simply click on the Share button in the first section.
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.
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.
To stop sharing folder in this Basic configuration, simply right-click shared folder, select the “Share with” option, and then select “Nobody”.
We can also share any folder by right-clicking it and then selecting the “Share with” option.
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 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).
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.
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.
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.
When we click OK, the “demoadmin$” will be added to the list of share names.
Share Name List
Let’s now check the \\WIN-7-VM.
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
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 /?.