Blogs‎ > ‎Tech Stuff‎ > ‎

2015.06.11 Windows File Sharing Follies

posted Jun 11, 2015, 2:04 PM by Troy Cheek   [ updated Nov 17, 2015, 2:14 PM ]
For a long time, I was the only person in my family who owned computers.  I had several networked together, dedicated to searching for aliens, recording and serving television shows, file storage, etc.  Then, for a while, we had a single "family" computer for everybody.  Now, it seems like every family member and visiting friend has multiple computers, laptops, tablets, and pads of some sort or another.  And, of course, everybody has files they'd like to share with at least one other person.  Hence, the unsecured LAN (Local Area Network) I've set up.  Sure, having an unsecured network is a bit of a security risk, but we live way out in the boonies.  If you're close enough to leech off our wireless, you're close enough to be picked off with a shotgun.

Most of the computers are running some kind of Windows, Vista or 7 mostly.  Vista gets a bad rap, but once all the patches and service packs came out, it worked pretty darn well.  Unfortunately, it wasn't patched into a usable shape until about a week before 7 came out.  7 is what convinced me to finally give up on XP and 2000, though I think I've got a "borrowed" laptop circulating among friends which still use one of those.

As I'm usually the source of most shared files, it falls upon me to set the sharing properties.  To share a file in most Windows versions, it's a simple matter of right-clicking on the drive or folder you want to share, selecting "share" in the drop-down menu, optionally set a few options, and clicking "OK" or "Apply."

Too bad that never works.

When I do some variation of what I just described, I get one of the following results:
  • The shared folder isn't visible from other computers.  It's like it was never shared.
  • The shared folder is visible, but trying to open it gives an access violation error.
  • The shared folder is visible and can be opened, but some or all of the files in it aren't visible.
  • The shared folder is visible and can be opened, but trying to open the files gives an access violation error.
  • The shared folder is visible and can be opened and all files can be accessed.
Now, right now some Windows expert is shaking his head, saying "Well, Uncle Troy, if you'll just walk me through exactly which options you're setting, I'll tell you exactly what you're doing wrong in each of those cases and we'll have you up and sharing in no time!"

The problem is, there is not "each of those cases."  It's not like I set option A and I have problem 1, set option B and have problem 2, etc.  The thing is I can set the exact same options on three folders and get three different results.  I'm going to repeat that:  I can set the exact same options when sharing folders and get different results when I try to access those folders.

One of the things a good user interface is supposed to strive for is consistency.  If the user does the same thing more than once, he expects the same results every time.  That sounds reasonable, doesn't it?  If I want to share a few folders, I should be able to click click click the same way for all three and get the same results.  I've been sharing files the same way on the same computer running the same version of Windows for years, setting the same options every time.  All the folders should be shared (or not shared) the same way.

Why doesn't that happen?

Let's say I get a new computer and want to have access to some files from an old computer.  It's a simple matter of sitting down at the old computer, sharing a few drives or folders, then sitting down at the new computer, navigating through the network to the old computer, opening up those drives or folders when I need the files.  Except, as explained before, some folders aren't visible or can't be opened, some of the files inside aren't visible or can't be accessed.

I try going back to the old computer and trying to copy files the other way, only to find out that the shared folders I just set up on the new computer are likewise screwed up.

I end up sitting down at the old computer, sorting through all the files on drive E: and drive F: and copying the ones I want to drive D: folder UNCLETROYSHARE because somehow, some way, that's the only folder the new computer can access.  All of which kind of kills the whole idea of sharing all the old folders and copying or just accessing the various files as needed from the new computer.

All I want to do is set up the occasional folder which I can share with everyone.  Is that so hard?

And, it turns out, it is.

I recently discovered that you can have Windows sharing settings and NTFS  sharing settings.  What is NTFS?  That's the File System used in Windows with the NT kernel, which was the various server versions throughout history and every consumer version starting with 2000/XP.  (I was always told the NT stood for Network Terminal, as the NT versions were designed for network servers.)  Apparently, setting sharing in Windows does not automatically pass those settings along to the file system, causing you to have to dig around and set more settings to actually share the file, though sometimes it does automatically pass those settings along to the file system, so you don't.

Furthermore, it turns out that part of the problem was that I was trying to share files with everyone.  Now, Windows has access groups with names like Administrators, Users, Guests, etc.  There are access groups which apply to all Users accessing a file from a certain computer, all Users who have logins on a certain computer even if they're accessing files from another computer, etc.  It can get very complicated trying to determine not only what access group has what access level, but what access group a particular User is a member of at a particular time.

Unbeknownst to me, Windows actually has an access group called Everyone.  Any User who is a member of any other group or no group of all is a member of the group Everyone.  If a folder is set to be shared with Everyone, then anyone of any group can access it.

Why wasn't that happening?

Well, it turns out, if you tell Windows to share a file, it doesn't automatically assume you want to share it with Everyone.  Sometimes it will, sometimes it won't, even if you're doing the same click click click you always do.  Or, at least, when I do it, it doesn't.  When I do it, I get this:
  • Everyone is not added to the list of groups who have access.
  • Everyone is added to the list, but not actually given any access.
  • Everyone is added, but only given read or some other limited access, perhaps not even access to list the files in the folder.
  • Everyone is added and given the access level I actually asked for.
I discovered this only recently, and going back to various folders on various computers that I've been trying to share unsuccessfully for literally years, I've discovered that the problem has always been that Everybody wasn't listed as a group having access or was listed but assigned no/limited access.

Sure, it's all my fault.  I've been doing it wrong.  I get that.  The problem I'm having is that I've been doing it the same way all these years.  If I'm always doing it the same way and that way is wrong, the question isn't why I can't share files.  The question is, how was I ever able to share files in the few cases where it did work?

Update November 17, 2015:  I bought a external drive the other day and had the same problem yet again, re-read this and realized I was a little vague on how to actually solve the problem.  With Windows Vista/7 (the only systems I have on hand to test), when you want to share a folder, right click, select Properties, select the Sharing tab, select Advanced Sharing, check the Share this folder checkbox, then click Permissions.  If the user Everyone doesn't exist, Add it.  Set Everyone to the permissions you want.  Now go to the Security tab.  Add Everyone if it doesn't exist and set the permissions you want.