Hiding single files from a directory listing

I'd like to hide two files from each directory, based on their extensions, from being listed when viewed by certain users.

I've worked with xcacls and have managed to make then inaccessible, but they are still visible when you enter the folder.

How can I do this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Harisha M GEngineerCommented:
Hi ninegoodthings,
    In NTFS..

    1) Select the file
    2) Right click --> Properties --> Security (Tab) --> Advanced.
    3) Select the user group.
    4) Click edit
    5) Select "Deny" for listing or anything you want.
    6) Click OK
    7) Uncheck "Inherit from parent.."
    8) Click OK, OK

ninegoodthingsAuthor Commented:
Ok, here's a more explicit idea of what I want, sorry for not making it clearer before.

I'm using the group "everyone" as my base. So, I give Everyone read access or I don't - I can't deny anything on that group because I will need to have it granted for some other groups (Administrators).

A solution would be if there's a user I can take permissions from which will only apply to people viewing a share.

Basically, I need to have these files visible to people on the computer, but invisible to people viewing the folders on a share.

It also needs to be done using xcacls...

Sorry for not specifying this before, I will double the points on the question.
Tim HolmanCommented:
No matter who and where you are, you can always view hidden files on a drive you have access to if you need to, so you're a bit stuck.
The hidden file attribute is designed to hide local system files from the user's view, so that a) they don't know they're there and b) can't delete them, unless they're clever system users who know how to unhide them.
There's really nothing more fancy you can do with this file attribute.
Why are you trying to do this?  Maybe there's a workaround?  Can't you just set RWX attributes to local users only, so that the file is Access Denied (but visible) to Everyone?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

ninegoodthingsAuthor Commented:
Here's the goal: I have many directories which contain files which need to be copied to other drives. Some of the files must NOT be copied, but must be visible on the original machine. I can restrict the read access, but if these files are still listed in the directory and a user tries to copy a entire folder, they will get an error once it comes time to copy the file they do not have read access for.

I need

1) To not change the location of the files
2) To hide certain files from users accessing the directories from a share
3) To allow users locally to see the same files
4) Setting the hide attribute is not an option

how about setting the "system" attribute with "attrib +s".

ninegoodthingsAuthor Commented:
Well, I see that it is not possible.


Thanks MS. Points will be split.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.