Best Firefox Extensions for Bookmarking Free CD DVD Blu-ray Burning Software Vista Feature Comparison Add Album Art in iTunes Top 10 Firefox Extensions, and More
Collapsed This Week Collapsed CyberNotes
Collapsed Last Week

CyberNotes
Tutorial Thursday


arrow Windows Windows only arrow
One of the things that I’ve always done on my Windows computers is have them show all of the hidden files. Some people think I’m crazy because this adds a lot more clutter, but it always seemed as though I frequently had to access files there were otherwise hidden. Sure I liked when some files were out-of-sight because I only ever mess with a handful of them, but the hassle of going into the Windows Explorer options every time I needed to see some hidden files just wasn’t worth it.

After a little research I had come across an article on the PCWorld forum that outlined how I could create a shortcut that would enable or disable hidden files on the fly. If the setting is enabled it would disable it when run, and vice versa. It’s one shortcut that serves as an on/off switch for hidden files. Here’s how you do it:

  1. Open up Notepad and paste in the following text:
    Set sh = CreateObject("WScript.Shell")
    theKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
    setHidden = sh.RegRead(theKey)
    If setHidden = 1 Then
    setHidden = 0
    MsgBox "System and hidden files will no longer appear in Explorer.",64,"Hidden File Exchange"
    Else
    setHidden = 1
    MsgBox "System and hidden files will appear in Explorer.",64,"Hidden File Exchange"
    End If
    sh.RegWrite theKey,setHidden,"REG_DWORD"
    Set sh = Nothing
  2. Save the file with any name you want, but make sure to designate the extension to be “.vbs”:
    notepad vbs.jpg
  3. Run the file that you just saved. Give it a few seconds to take affect, but you should see the results without even having to restart Windows Explorer.
  4. If you want you can place this script file anywhere you’d like on your computer, and then you can create a shortcut to it by right-clicking on the file. I recommend placing a shortcut to the file in the Windows Explorer Favorites for fast access from the Favorites menu.

Compatibility: I’ve verified that this works on Windows XP, but it only works on Vista when User Account Control (UAC) is disabled. This is because it needs access to the registry, and Vista doesn’t allow that unless it is run as an administrator. Since it is a VBS file the “Run as Administrator” option does not appear when right-clicking on the file.

By default the script will prompt you with the current setting for the hidden files each time you run the script. That way you know whether you are turning them on or off. If you don’t want to see the prompts just remove the following two lines that I’ve highlighted in the code:

hidden files message box.jpg

Now you are all set with a shortcut that can enable or disable hidden files in Windows Explorer. This should help reduce the clutter you see on a regular basis by keeping the hidden files out-of-sight when they’re not needed, and then pulling them up when you need to make a change. How convenient is that?

RSS Icon This is just one of the hundreds of CyberNotes we have done. You can find more of them by visiting our CyberNotes category, or by subscribing to our CyberNotes feed. We also have a full feed available if you want to receive all of our articles in your reader!

Tags: CyberNotes, Software, Windows, , , ,

Previous ArticleNext Article
 

Related Posts:


16 Unread Comment Tracking CyberMark This Article
RSS Icon
16

  1. Avatar

    This is a really neat shortcut. Thanks for this. It will be very useful to me.

  2. Avatar

    Nice hint! I’ll keep this script around, but I use HiddenFilesToggle (a Contextual Menu (CM) item):

    http://www.msfn.org/board/Here.....52524.html

  3. Avatar

    nice; i guess a similar thing for “show/hide extensions for known filetypes” would be easy (anyone know how to do it?)

  4. Avatar

    I tried this script, and it doesn’t really work for me (WinXP SP2). It detects the current Hidden state, and toggles the setting in the Registry, but the hidden files do NOT toggle on/off. What’s missing is some type of “broadcast” message that tells Explorer to reload or something. You can see this when you bring up a File Type setting from the Explorer Folder Options and then dismiss it (you can see Explorer refresh, and your hidden files will toggle if you had run this script previously).

    Any way to include the broadcast in this script? :!:

  5. Avatar
    hypert wrote:
    I tried this script, and it doesn’t really work for me (WinXP SP2). It detects the current Hidden state, and toggles the setting in the Registry, but the hidden files do NOT toggle on/off. What’s missing is some type of “broadcast” message that tells Explorer to reload or something. You can see this when you bring up a File Type setting from the Explorer Folder Options and then dismiss it (you can see Explorer refresh, and your hidden files will toggle if you had run this script previously).

    I haven’t found a way to broadcast to Windows Explorer that a change has been made, but it took less than 5 seconds for Windows Explorer to detect the change on my XP machine.

  6. Avatar

    Hi, to broadcast the info, you have to
    - enum processes to find all explorer.exe and get their pids
    - get their window handle
    - post to each window the following message:
    WM_COMMAND, 41504, 0 (vista)
    WM_COMMAND, 28931, 0 (xp (and previous?))

    Or, there ’s a nice shell toolbar here that have the feature and it is imediate: http://tools.tortoisesvn.net/StExBar

  7. Avatar

    Thanks for the easy to follow instructions. This is a useful tip indeed!

  8. Avatar

    Nice tip!!BTW,I also need another shortcut for show/hide file exetension in windows.

  9. Avatar

    You might get a bit more technical, learn programming (are you really a developer u say?) and call this a script, not be shortcut. :D

  10. Avatar

    Now I have ever faster access to my pron!!! ;)

  11. Avatar
    anon wrote:
    You might get a bit more technical, learn programming (are you really a developer u say?) and call this a script, not be shortcut. :D

    I mentioned that you can create a shortcut to the script, and so this does tell you how to create a shortcut to do the deed.

  12. Avatar

    reallly nice shortcut m8..i will try this one

  13. Avatar

    I’m running Windows Vista as a limited user (not admin), with UAC turned on, and this worked a treat - it doesn’t even ask for the admin password, or confirmation that i want to allow it to run. You do have to refresh Explorer for it to take effect though. If you create a shortcut to the VBS file, and then look at the properties of that shortcut, you can give it a keyboard hotkey as well: I’m using Ctrl+Alt+H. sweet!

  14. Avatar
    Anonymous wrote:
    I’m running Windows Vista as a limited user (not admin), with UAC turned on, and this worked a treat - it doesn’t even ask for the admin password, or confirmation that i want to allow it to run.

    That’s odd, it’s not supposed to execute registry modifications without a UAC prompt?

  15. Avatar

    pure genius!!! thanx!!!

  16. Avatar

    Now how about telling us how to make a keyboard shortcut to this file. :P

:mrgreen: :| :twisted: :arrow: 8O :) :? 8) :evil: :D :idea: :oops: :P :roll: ;) :cry: :o :lol: :x :( :!: :?:

Note: All links posted in comments will automatically be hyperlinked.

↓ Expand Text Area  or  Decrease Text Area ↑

 Find out how to track new comments!


 

  1. There aren't any trackbacks or pings yet. You can be the first by using this trackback URL.