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

Page 1 of 2 12 LastLast

  1. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #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 Computer


  2. Posts : 11,269
    Windows 7 Home Premium 64 Bit
       #2

    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 Computer


  3. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #3

    writhziden said:
    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?
    Last edited by pxfragonard; 03 Apr 2012 at 22:33. Reason: Forgot something
      My Computer


  4. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #4

    Oops! I just realized that the file extension is .CR2.dop and I'm worried that I'd hide all the .CR2 files....
      My Computer


  5. Posts : 1,036
    Winbdows 7 ultimate x64 | Ubuntu 12.04 x64 LTS
       #5

    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
    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.


    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.


    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 Computer


  6. Posts : 11,269
    Windows 7 Home Premium 64 Bit
       #6

    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 Computer


  7. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #7

    EzioAuditore said:
    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
    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.


    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 Computer


  8. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #8

    writhziden said:
    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 Computer


  9. Posts : 11,269
    Windows 7 Home Premium 64 Bit
       #9

    pxfragonard said:
    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 Computer


  10. Posts : 1,036
    Winbdows 7 ultimate x64 | Ubuntu 12.04 x64 LTS
       #10

    pxfragonard said:
    writhziden said:
    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 Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 15:26.
Find Us