Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible for Windows to automatically hide files with a certain extension?

Let's say some program generates a set of files (I cant alter the sources of the program), and I would like some of these files to be recognized by the system by their extension and automatically set hidden – is it possible?

share|improve this question

migrated from Oct 15 '11 at 6:11

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

You can create a program (possibly running as a service) that will monitor changes in a given directory. Then, whenever it recognizes a change, it can decide whether to make that file hidden or not. See Obtaining Directory Change Notifications.

Making a file hidden is quite simple - just use SetFileAttribute.

share|improve this answer

Hiding a file is not the property of OS. Its the properties of the file which makes it visible or hidden and I don't think windows support hiding files by extension. But you can write your own program which will take the extension and then it will apply

 "attrib +h *.<ur_extension>" 

on the folder and it will hide all the files of that extension. You can create a simple vb script and then execute it after the previous program has ended.

share|improve this answer

Windows [7 x64] supports hiding files by extension. At least it's able to do so, because: all .INI files are created as "hidden". And it's p to the user if he wants to see hidden files or not. I already hide "hidden" folders and files [so I don't get angered by the multiple desktop.ini files] and I would like to add to them now all those future .SFK files

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .