Hide Folders and Files Using System File Attribute

Hide folders and files (AppData ntuser)I like keeping my folders tidy. In Windows XP, it's an easier task because there aren't many things in the user directory that can make things look cluttered. However, in Vista, there are three things that I just can't stand looking at: the AppData folder and the ntuser.dat.LOG files. There is simply no need for me to mess with the ntuser.dat.LOG files, and I hardly need to access files in AppData. I can't delete them, so I hide them.

Just a note before going on: The following instructions rely on a setting in Vista. The key is to have "Hide protected operating system files (Recommended)" checked. By default, this setting is already checked, but you can double check by clicking on "Organize" on any Windows Explorer window, and choosing "Folder and Search Options". On the "Folder Options" window, click the "View" tab and it should be as shown below.

Hide protected operating system files (recommended)

In some cases, I need access to files that are hidden by default and I've set Vista to show hidden files and folders, hence setting the "Hidden" attribute on folders and files isn't sufficient.

Moving on: Set the "System File" Attribute for files you want to hide

Now that you've set Vista to hide system files, we can use the command prompt to make folders and files have the "system file" attribute.

  1. Open a Command Prompt window. (Start->All Programs->Accessories->Command Prompt). For some files, this must be run with Administrator privileges . In that case, right click on Command Prompt, and click “Run as administrator.”
  2. By default it should already open in the "C:\Users\[your_username]" directory.
  3. Type "attrib +S +H AppData" to hide the AppData directory.
  4. Type "attrib +S +H ntuser.dat.LOG1" to hide ntuser.dat.LOG1.
  5. Type "attrib +S +H ntuser.dat.LOG2" to hide ntuser.dat.LOG2.
  6. Look at your user directory in Windows Explorer and they should not be showing anymore. (A refresh might be required to see the changes)

This should also work on any folder or file, and I don't find any reason why this wouldn't work in Windows XP or Windows 2000, but I could be wrong. If you're using another version of Windows, getting to the "Folder Options" might be a little different.

Also, be cautious when deleting folders and files. Remember the ones you've hidden!

If you ever need to undo this, simply substitute the "+S +H" with an "-S -H" in the instructions above.


Tags: How To, Tips, Vista, Windows

Bookmark and Share

Comments