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.

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 stackoverflow.com Oct 15 '11 at 6:11

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

add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.