Is it possible for the windows system to automatically hide files with 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?

link|improve this question
feedback

migrated from stackoverflow.com Oct 15 '11 at 6:11

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

2 Answers

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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