Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Is there a way to hide files of only one particular extension/type?

03 Apr 2012   #1

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
Is there a way to hide files of only one particular extension/type?

I use a program that saves a data file for every image that I process. It's called DxO Optics. This is unlike Photoshop Lightroom 4, which stores that info in a database. It's inconvenient to scroll thru these files which show up as icons. Is there a way to make files invisible by type? These ones have the extension .dop and just show a white page. So far all I see is hide/show in tools/view but I hope there's a way to just hide those files in explorer. Any chance of that?

My System SpecsSystem Spec
.

03 Apr 2012   #2

Windows 7 Home Premium 64 Bit
 
 

You can create a batch script (call it hide.bat for instance) in the folder and put in the batch file:

attrib +h *.dop
Then just run the batch file when you want to hide the files. If you need step by step instructions for how to create a batch file:
  • Open the folder in question
  • Click on Organize (upper left corner of the window under the back and forward buttons)
  • Folder and search options
  • View tab
  • uncheck hide extensions for know files types
  • click OK
  • Right click in an empty area of the folder (careful not to right click on a file)
  • Click New -> Text Document
  • Delete all the text in the text document name including the .txt part
  • Name the file hide.bat
  • Right click hide.bat and click Edit
  • Type in the command I gave above for attrib +h *.dop
  • Save, and exit.
  • That's it; you can hide extensions to known file types again if you want.
My System SpecsSystem Spec
03 Apr 2012   #3

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by writhziden View Post
You can create a batch script (call it hide.bat for instance) in the folder and put in the batch file:

attrib +h *.dop
Then just run the batch file when you want to hide the files. If you need step by step instructions for how to create a batch file:
  • Open the folder in question
  • Click on Organize (upper left corner of the window under the back and forward buttons)
  • Folder and search options
  • View tab
  • uncheck hide extensions for know files types
  • click OK
  • Right click in an empty area of the folder (careful not to right click on a file)
  • Click New -> Text Document
  • Delete all the text in the text document name including the .txt part
  • Name the file hide.bat
  • Right click hide.bat and click Edit
  • Type in the command I gave above for attrib +h *.dop
  • Save, and exit.
  • That's it; you can hide extensions to known file types again if you want.
Wow! That's great and yes, I did need step-by-step instructions. Two questions:

1) Do I have to leave the spaces in attrib +h *.dop between attrib and + and h and *?
2) Will it work in all subfolders (I have a LOT of folders in which these pesky files are visible)?

Oh and
3) If I need to see them again, just restart the computer?
My System SpecsSystem Spec
.


03 Apr 2012   #4

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Oops! I just realized that the file extension is .CR2.dop and I'm worried that I'd hide all the .CR2 files....
My System SpecsSystem Spec
03 Apr 2012   #5

Winbdows 7 ultimate x64 | Ubuntu 12.04 x64 LTS
 
 

Quote:
1) Do I have to leave the spaces in attrib +h *.dop between attrib and + and h and *?
Yes, there is a indeed a space between them.
Code:
attrib +h *.dop
Quote:
2) Will it work in all subfolders (I have a LOT of folders in which these pesky files are visible)?
You'll have to edit the bat file to change to the directory first i.e. add
Code:
Code:
cd \path\to\directory
before the attrib line.

Someone correct me if i'm wrong.


Quote:
Quote:
3) If I need to see them again, just restart the computer?
Restarting won't do as the 'hidden' attribute has been added to the files. You'll have to either select 'Show hidden files and folders' from Tools>Folder options or edit the bat file w/ the +h replaced w/ -h.


Quote:
Oops! I just realized that the file extension is .CR2.dop and I'm worried that I'd hide all the .CR2 files....
The extension of this type of file would still be .dop. Windows treats the words after the last dot as extension.
My System SpecsSystem Spec
03 Apr 2012   #6

Windows 7 Home Premium 64 Bit
 
 

Another option is to put the batch file in the top level directory. You could make two batch files, one with a +h called hide.bat and one with a -h called unhide.bat for instance. In the top level, create the hide.bat file with this command:
attrib /s /d +h *.dop
and the unhide.bat file with:
attrib /s /d -h *.dop
These will hide/unhide all files in the current directory and every subdirectory within that directory.
My System SpecsSystem Spec
04 Apr 2012   #7

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by EzioAuditore View Post
Quote:
1) Do I have to leave the spaces in attrib +h *.dop between attrib and + and h and *?
Yes, there is a indeed a space between them.
Code:
attrib +h *.dop
Quote:
2) Will it work in all subfolders (I have a LOT of folders in which these pesky files are visible)?
You'll have to edit the bat file to change to the directory first i.e. add
Code:
Code:
cd \path\to\directory
before the attrib line.

Someone correct me if i'm wrong.


Restarting won't do as the 'hidden' attribute has been added to the files. You'll have to either select 'Show hidden files and folders' from Tools>Folder options or edit the bat file w/ the +h replaced w/ -h.


Quote:
Oops! I just realized that the file extension is .CR2.dop and I'm worried that I'd hide all the .CR2 files....
The extension of this type of file would still be .dop. Windows treats the words after the last dot as extension.
Thanks not only for an answer but a great deal of insight into how these things work.
My System SpecsSystem Spec
04 Apr 2012   #8

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by writhziden View Post
Another option is to put the batch file in the top level directory. You could make two batch files, one with a +h called hide.bat and one with a -h called unhide.bat for instance. In the top level, create the hide.bat file with this command:
attrib /s /d +h *.dop
and the unhide.bat file with:
attrib /s /d -h *.dop
These will hide/unhide all files in the current directory and every subdirectory within that directory.
Thanks for a very elegant and simple solution. I take it s / d means subdirectory... very nice!
My System SpecsSystem Spec
04 Apr 2012   #9

Windows 7 Home Premium 64 Bit
 
 

Quote   Quote: Originally Posted by pxfragonard View Post
Thanks for a very elegant and simple solution. I take it s / d means subdirectory... very nice!
The /s means all files within the directory containing that extension will have the attribute applied. /d, as you guessed, means all directories and subdirectories will be checked for files with that extension. The directories themselves will not be hidden, but the files with that extension contained in the directories will have the hidden attribute applied or removed.
My System SpecsSystem Spec
04 Apr 2012   #10

Winbdows 7 ultimate x64 | Ubuntu 12.04 x64 LTS
 
 

Quote   Quote: Originally Posted by pxfragonard View Post
Quote   Quote: Originally Posted by writhziden View Post
Another option is to put the batch file in the top level directory. You could make two batch files, one with a +h called hide.bat and one with a -h called unhide.bat for instance. In the top level, create the hide.bat file with this command:
attrib /s /d +h *.dop
and the unhide.bat file with:
attrib /s /d -h *.dop
These will hide/unhide all files in the current directory and every subdirectory within that directory.
Thanks for a very elegant and simple solution. I take it s / d means subdirectory... very nice!
Here's what they mean:

/S Processes files in all directories in the specified path.
/D Process folders as well.

You can type attrib /? in a command window to know as what switches does it support and what they do.

If you just type /? you'll get a list of all the commands with their respective brief explanation...

You can do wonders (as i like to say) by mastering the commandline.. :P
My System SpecsSystem Spec
Reply

 Is there a way to hide files of only one particular extension/type?




Thread Tools



Similar help and support threads for2: Is there a way to hide files of only one particular extension/type?
Thread Forum
File Extension Type - Unassociate Tutorials
Permissions error when opening a file with unknown extension type General Discussion
.lnk extension and shortcut type file General Discussion
How to hide some new extension file type? Customization
Chrome gives the option to hide any extension button? Browsers & Mail
Make explorer hide folders or hide files? General Discussion
File type Association (.exe, .jpg, ...) Add extension? General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:00 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33