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

Page 2 of 2 FirstFirst 12

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

    writhziden said:
    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.
    Thanks very much!
      My Computer


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

    EzioAuditore said:
    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
    Mastering the command line is way beyond me now but it's exciting to know you can make computers do any logical series of things because it's just a machine. I'm going to try to understand and work toward that goal.
      My Computer


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

    pxfragonard said:
    EzioAuditore said:
    pxfragonard said:
    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
    Mastering the command line is way beyond me now but it's exciting to know you can make computers do any logical series of things because it's just a machine. I'm going to try to understand and work toward that goal.
    Even a 1000 miles journey begins with a single step. So, good luck exploring!
      My Computer


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

    Thanks guys. Solved!!!
      My Computer


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

    You're welcome; that's excellent. Glad you learned a bit along the way, too. :)
      My Computer


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

    It's quite fascinating. I'm going to try to learn about the command line functions!
      My Computer


  7. Posts : 4
    windows 7 home premium 64bit
       #17

    one more question on this topic...
    does the attrib command to hide a file type continue to apply to new instances of a given file type, or does it only hide files which are in existence at the time the .bat file is run?
      My Computer


  8. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #18

    The Attrib command will not continue to hide new instances of a file type. You will have to set the Hidden attribute onto new files for them to be hidden.
      My Computer


  9. Posts : 4
    windows 7 home premium 64bit
       #19

    Thanks for the speedy reply, Pyprohly! I figured as much, but it doesn't hurt to ask.

    So, if you designate a particular file extension as a system /hidden file, how is that different from other system (hidden) files, which become hidden as part of the general operations of the system (ie without the user running a .bat file, thus setting the hidden attrib? (ie get the +h attribute)? Are they made to be hidden by the OS, or some other process that has not been discussed here?
      My Computer


  10. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #20

    cutedrdave said:
    So, if you designate a particular file extension [...]
    File Attributes are relevant per item (whether file or folder), and not per file type or extension.

    cutedrdave said:
    [...] as a system /hidden file, how is that different from other system (hidden) files
    Under what meaning of 'different' do you refer? Would you like to give an example of a sort of difference you are expecting?

    Do note that Hidden and System are two different types of File Attributes. A System marked file does not necessarily imply hidden.
      My Computer


 
Page 2 of 2 FirstFirst 12

  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 06:09.
Find Us