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?


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.


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.


Windows 7 and onwards:

  • create a new Library in Explorer
  • collect all the folders you need into the Library
  • Set view options for the Library
  • In the top-right search field, type "type:=NOT *.ext (replace ext with extension)
  • (you will get a rolled up view of the search results)
  • expand each group of results
  • click on "Save Search", and save the file
  • (you get a multiple-folder search in which files with some extension are omitted in the results)
  • DOWNSIDE: the results are hard grouped by date; you can still sort the files by some criteria, but you won't be able to group them by something else

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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