Wednesday, June 13, 2012

How to automatically hide files with specified extensions

This is a useful trick for our San Diego customers that use production software. When importing a file that isn't natively supported by a program, that program will sometimes compensate by converting the imported file into a format that it natively supports. Afterwards, the converted file is saved as a new file. This can be annoying as it leaves you with multiple copies of the same file in various formats. A solution to this would be to make a batch file that hides specified extensions and have it execute on startup.


This is one I use. Since I have hidden files set to show by default, I make them "protected system files" as well so I can't see them (Doug's idea). This batch hides .sfk's and .asd's and runs on everything in my C: drive, which takes roughly 2 seconds (10,000rpm drive, 160GB of data).


If you don't need to turn them into protected system files, remove the +s modifier. Use the first line to navigate to your folder if it you want to only run there. The /s modifier has it hit all subdirectories and the /d modifier doesn't. When you have edited the extensions, drop it in the startup folder.


So far I have not had any issues with my programs accessing or modifying any of the files that get changed, but I recommend testing everything after a first pass. Also, if the folder ever needs to be deleted, it can't contain system files. Navigate to the folder in command line and use:


attrib -s *.* /s 


Brett Kline

Mobile Computer Wizard
619 255-1215 Office

 


 


 

1 comment: