25 September 2009

File SharingThere are many things to love about Windows 7. It truly is “Vista done right”, sad as that may be. But it ain’t perfect.

One of the most common problems, as I recently discovered, is that you tell Win 7 to share only your Public directories, but it doesn’t quite listen. Due to some apparent bug that is at least present in the Release Candidate build of Win 7, sometimes the OS will share your entire Users directory, which includes your Public files/folders. That means ALL your files are shown to the whole world on your LAN – not just the your public folders.

Fortunately, it’s pretty easy to fix this little problem once you know a few little bits of information…


I know, I know – you shouldn’t have to dig into the guts of file sharing and permissions. It should “just work”. Well, don’t feel bad. Try sharing some directories with the whole world on a Mac or Linux box without a password, and you will quickly find yourself delving into the horrors of Samba config files. At least Win 7 doesn’t make you do that sort of frustrating crapola. Count your blessings.

Anyhow, here’s how Windows 7 shares stuff: There is a Users directory, typically C:\Users. Under this Users directory is the directory for your user account, which we’ll say is C:\Users\Scottie. Then there is also another subfolder for publicly-shared directories: C:\Users\Public. Pretty easy, right?

Normally, yes. But sometimes, when you use the Win 7 GUI – the “Network and Sharing Center” – your C:\Users\Public folder is shared, AND your entire C:\Users\Scottie folder (“Scottie” will be different in your case) will also be shared, much to your dismay. Nevertheless, Windows will still tell you via the GUI that only your Public folders are shared. Oops.

You might think that you can simply right-click the Users folder, look at the Sharing tab, and just sort things out quickly and easily. Unfortunately, it isn’t quite so simple. In Windows 7, file sharing depends on two things: the file sharing settings, and the folder’s permissions.

So, if you want to keep your Public shared, but hide the files under your personal Users directory, here’s how to do it…

Step 1 is to hide the entire C:\Users directory:

  1. Open Explorer and right-click on the C:\Users folder and select Properties.
  2. Click the Sharing tab, and then click the Advanced Sharing button (NOT the “Share…” button!!)
  3. Click the Permissions button, select “Everyone”, and then clear the checkboxes for “Full Control”, “Change”, and “Read”.
  4. Click OK, and then clear the “Share this folder” check box in the Advanced Sharing window.
  5. Click OK, and then close the Properties window

At this point, you will have successfully unshared the entire Users directory, including the Public dir and all its subdirectories. You can verify this by connecting to your computer from another machine on the LAN.

Okeydokey. Now, if you want to make your Public dir show up again, just do the following:

  1. Open Explorer and go to C:\Users.
  2. Right-click on the Public folder and select Properties.
  3. Click the Sharing tab, and then click the Advanced Sharing button (again, NOT the “Share…” button!)
  4. Click “Share this folder” and give it a Share Name of “Public”
  5. Click the Permissions button, select “Everyone”, and then make sure to check the boxes for “Full Control”, “Change”, and “Read”. If you only want people to be able to read the files in your Public dirs, just check “Read”.
  6. Click OK, OK, and the close the Properties window.

You’re done! Note that when you share/unshare folders, you’ll probably have to wait a moment or two while the permissions on all the files and folders are changed. In any case, you can now go once again to another computer on your local network and verify that only your Public folder is shared.

This little trick is also useful if you’d like to set up file sharing the way it worked in Vista. In Vista, when only your public was shared, it would show up on the network as: \\Scottie\Public

In Windows 7, Microsoft for some reason decided it would be more fun to confuse everyone by changing the network path to: \\Scottie\Users\Public

Because, ya know, confusing changes like that always help everyone!

But, no worries – you can now make 7 work like Vista, and anyone on your LAN with your drives mapped will actually see your files again instead of an error when you upgrade from Vista to 7.

Have fun!

Windows 7 File Sharing: Fixing the “Entire User Directory Shared” Problem
Tagged on:         

14 thoughts on “Windows 7 File Sharing: Fixing the “Entire User Directory Shared” Problem

  • 16 November 2009 at 17:03
    Permalink

    First of all, thanks. Your fix seems to work OK.
    I cannot believe that Microsoft allowed this security problem to exist in the first place with all the previous security issues in Windows. But seeing is believing.

    Reply
  • 4 February 2010 at 20:45
    Permalink

    Thanks. That seems reasonable, but odd that it was allowed to escape in the RC. Now that W7 is out I can’t say that I can see into this W7 machine as described. I’ll check.
    BUT, what I’m finding is that this Win7 computer is looking straight into a Vista box on this LAN as though no permissions at all exist. Extraordinary. A Standard User looking into users and admins alike. =8-0

    Reply
  • 20 June 2011 at 21:01
    Permalink

    Thanks, Scottie.
    Quite some water’s flowed under the bridge since the last post; I’ve found that playing with HomeGroup releases all the permissions as you’ve described. Closing any HomeGroup still leaves the permissions open.. so I hear!
    There’s a couple ore wrinkles to the subject: 1. Do you know of any implications of ignoring the wanring that ‘This folder is already shared’ when you try to make a share out of a folder within it? That’s, say, Documents within Public. The warning may be referring to just the redundancy, but it’s such an ‘upset’ warning. 8-|
    2. You caution us against using the Share button when doing permissions. I’ve heard of all sorts of arcane magic about this, drawn from my two year hunt to make Win7 allow XP peers to see its shares.. So, the Share button?

    Reply
    • 20 June 2011 at 21:12
      Permalink

      From what I’ve seen, sharing a folder within an already shared parent folder doesn’t cause any problems. And it can be very handy if you have a shared folder with gobs of subfolders, and you just want one of those subfolders to appear at the top level for that machine when browsing its shares.

      As for the Share button, I never do it the easy way because it always causes headaches. I always do the right-click, Share tab, Permissions change, and then OK. Otherwise, there is ALWAYS a problem later on. Silly, but true.

      Reply
  • 14 September 2011 at 11:51
    Permalink

    Scottie, you are a god! Thank you! I almost killed something going thru all that network sharing conundrum. Thanks again! Google bless you! XD

    Reply
  • 1 November 2011 at 07:15
    Permalink

    Regarding Win7 pro – What a bleeding ridiculous arrangement. I received a update from Microsoft then after a week I checked and some of my Docs and folders where in the “Shared Public Library” I disabled the My Documents shortcut from the start menu and now use a actual shortcut to My Docs. Then weeks later I am on a different wireless network and I check and poof My Documents is being shared with 6 people I don’t know. Of course everything is disabled now and the File and printer Sharing is disabled in the network adapter properties for the wireless and the Local Area Connection(just to be sure). What the heck is Microsoft doing? Each operating system changes and now this file sharing crap is a surprise. It’s a mess and the file sharing radio continually sets itself back to enabled. I for one am sick’n tired of Microsoft changing critical stuff and leaving me to figure it all out by trial and error. From Win95b to Win7Pro I have had nearly all the version of OS and am fed up with the constant rearranging and resultant continual tech support I need provide each time I get the newer OS. Can’t Microsoft make changes although leave the GUI basically the same or even put all the networking crap on one page instead of allllll overrrr everywhereeee? Your pissing me off Microsoft and I am near my wits end with that. Soon hopefully aa Linux OS will come that has some respect for the users and is suitable for a gaming overclocker box.

    Reply
  • 25 March 2012 at 09:38
    Permalink

    lol Had to reformat my laptop and had to go through all that network-sharing nightmare again. Good thing I remember this place. =D

    Reply
  • 4 November 2012 at 22:16
    Permalink

    Thanks! This worked great.

    Reply
  • 10 March 2013 at 02:17
    Permalink

    Thanks. I hated that everyone could see my users folder.

    Reply
  • 26 May 2014 at 19:21
    Permalink

    just recently found out about this.. I un-shared the folder but the next time I booted up Win7 it was sharing the folder again… 🙁

    Reply
  • 9 August 2016 at 18:05
    Permalink

    THANKS! Worked as described for me. Remained not shared even after reboot.

    Reply
  • 16 January 2017 at 17:06
    Permalink

    Hi
    Thanks for the post here , I was actually trying to get it to show all users In the users folder , I could only see the public folder when i try to access the PC from another Win 7 pc and vice versa, where as on MAC I could see all users in the users folder . Anyways I think it is best to just share Public folder and not all users documents . Microsoft could see this but surprisingly not Apple. Anyways would you be able to point out where does the data on public folder goes once sharing is turned off. I have lost quite a lot of data on public folder of a Win 7 pc when i was fiddling with the Networks and Sharing in order to get Windows 7 to show all user along with public folder .
    Anyways Thanks for the post.Cheers

    Reply
    • 16 January 2017 at 21:50
      Permalink

      The Public folder is: C:\Users\Public
      Individual folders for Music, Pictures, etc. are subdirs of the above, so like: C:\Users\Public\Music
      Whether nor not the Public folder(s) are shared shouldn’t matter; the data should stay where it is.

      Reply
  • 16 January 2017 at 23:53
    Permalink

    Thanks for your reply , Could you say how do i undo the above process the 6 steps process, I created the folder naming it as C , Now I don’t have permission to open that but Public Folder does shows user (name) folder and a public folder of which I cannot access the user(name) folder .This cannot get any more weird ………..

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.