Windows only
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:
- 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 - Save the file with any name you want, but make sure to designate the extension to be “.vbs”:
- 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.
- 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:
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?
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, How To, Tips And Tricks, Windows Vista, Windows XP
Related Posts:
- Your Week in Review with Sunday’s Summary
- CyberNotes: Disable And Remove Thumbs.db In Windows XP
- Get Your Own Hidden Passageway
- Notepad++ 4.0 Now Available!
- CyberNotes: Override & Modify Keyboard Shortcuts on a Mac
This is a really neat shortcut. Thanks for this. It will be very useful to me.
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
nice; i guess a similar thing for “show/hide extensions for known filetypes” would be easy (anyone know how to do it?)
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?
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.
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
Thanks for the easy to follow instructions. This is a useful tip indeed!
Nice tip!!BTW,I also need another shortcut for show/hide file exetension in windows.
You might get a bit more technical, learn programming (are you really a developer u say?) and call this a script, not be shortcut.
Now I have ever faster access to my pron!!!
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.
reallly nice shortcut m8..i will try this one
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!
That’s odd, it’s not supposed to execute registry modifications without a UAC prompt?
pure genius!!! thanx!!!
Now how about telling us how to make a keyboard shortcut to this file.