Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How should I go about automatically hiding files that I paste/drop in a folder, for example C:\test\ ?

I thought about creating a batch file or using a program which runs continuously on the desktop and scans for new files in the folder, then hides them. However, I don't know what program, or what commands to put into the batch file.

share|improve this question
Why don't you just hide the folder? –  terdon Sep 14 '13 at 15:35
Because I add files daily, and it's a repetitive task to keep on going in the proterties/hide folders... I would like to automate it. –  Conrad Sep 14 '13 at 15:36
I mean hide the parent folder, that way you don't need to hide the files and everything you add subsequently will be hidden because the folder itself is. This would be easier to understand if you explained why you want the files hidden, it sounds like an XY problem. –  terdon Sep 14 '13 at 15:38
@terdon exactly like i said in my answer –  PsychoData Sep 14 '13 at 15:39
Note that if you have show hidden files and folder turned on that you will still see the C:\test or C:\test\hidden folder, but regular people wouldnt –  PsychoData Sep 14 '13 at 15:58
show 3 more comments

4 Answers

up vote 3 down vote accepted

However, I don't know what program, or what commands to put into the batch file.

I believe the command you are looking for is attrib. Example:

attrib +h "c\dir\test1\*" /s


+h: Sets the hidden file attribute.

/s: Applies attrib and any command-line options to matching files in the current directory and all of its subdirectories.

See also this winapi SetFileAttributes.

SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN);

You can use this function recursively to apply the appropriate attributes to the files in the folder.

Attribute Changer(Free).

enter image description here

Attribute Changer is a freeware tool that allows you to set file attributes on multiple files and folders, recursively.

share|improve this answer
add comment

A different solution would be hiding the folder, files inside it are still visible, but you wont see the folder they are in listed (unless you have hidden files shown)

so, for example, if you Open C: you'll see WINDOWS, other crap and other other crap, but not C:\test

If you open C: then go to the bar and type in \test it will show you your hidden files very nicely

share|improve this answer
No, you're right, but you didn't seem to read my entire post. I didn't answer his question, I responded by confirming his suspicions and then offering an alternative to his thought process. Please actually READ my post and notice that I even said "A different solution would be hiding the folder" showing that I am not hiding the files, but instead the folder. Therefore making it an ALTERNATIVE. Let the OP be the judge of whose answer solves his problem. –  PsychoData Sep 14 '13 at 15:35
I read your entire post, but the fact that you started off your answer by saying he needed "some kind of program" and essentially offering up for an answer exactly what he said already in his question was worth a downvote. Terdon removed it, so I removed my downvote... however, oddly enough, now someone is serial downvoting my answers. Funny that. –  Bon Gart Sep 14 '13 at 15:51
So you're saying that it's wrong that I confirmed what he thought before I offered an alternative? Why is that bad? –  PsychoData Sep 14 '13 at 15:54
He says he wants to use a program of some kind to automatically check for new files and hide them. You tell him as an answer that he needs "some kind of program" that will check for and hide the files automatically, OR AS AN ALTERNATIVE he can just hide the whole folder. That's not confirming what he thought. That's just repeating back to him what he said, and calling it an answer. Shall I revert Terdon's edit so we can review your exact wording? –  Bon Gart Sep 14 '13 at 15:59
If you feel that terdons edit wasnt appropriate, then revert it. Would you have preferred I structure my answer differently and said "An alternative would be.... and if you want to hide the individual files you would need some program or something that I'm not aware of?" There are two parts to my answer, a conceptual approach to how a program such as he is looking for would work (not saying JUST that he needs one) AND offering an alternative that might be easier. There is always the possibility that he would have taken a shine to making his own program to check for new files and then hide 'em –  PsychoData Sep 14 '13 at 16:18
show 9 more comments

You could set up a Scheduled Task every so often that performs the command:

ATTRIB +H "C:\Test\*" /S /D

This command sets all files and subfolders/files hidden within the target directory.

While this isn't automatic as you described you wanted, you could set it to run every few minutes.

You could also run the command as a batch after you place files in the folder, or assign it to a hotkey.

share|improve this answer
or all three for good measure :P –  PsychoData Sep 14 '13 at 15:59
And on shutdown and startup XD –  Moses Sep 14 '13 at 16:09
and anytime the computer is idle for more than a couple minutes (but less than how often you schedule it to run) XD –  PsychoData Sep 14 '13 at 16:10
It could have a performance penalty if there are lots of files, especially if this command is run often. –  Alexey Ivanov Sep 14 '13 at 16:54
@AlexeyIvanov True, which is why an on-demand hotkey or shortcut would be the best option in that case. –  Moses Sep 14 '13 at 16:58
add comment

I doubt that there is a tool that does this. However, you could easily create a Windows Service using C# or any other .Net language which observes this folder using the FileSystemWatcher. You could process files that are discovered in the created event and set the attributes accordingly.

share|improve this answer
A comment about why this is downvoted would be nice. I don't know any tool that does what the OP wants. I saw that he's also on SO and posted multiple times under the .Net and C# tag. Why shouldn't this answer be a good answer leading him to a real solution for his specific problem? –  wullxz Sep 18 '13 at 23:02
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.