In its default settings, Windows Explorer conceals two types of files: those with the hidden attribute set, and those designated as system files. Some people, including my occasional writing partner Woody Leonhard, think you should always enable the display of hidden files. I don’t agree – in general, I prefer to keep system and hidden files hidden except when I need to solve a particular problem. To change Explorer’s settings so hidden and system files are visible, open any Explorer window and click Tools, Folder Options (or click the Folder Options icon in Control Panel). On the Folder Options dialog box, click the View tab and select the Show hidden files and folders checkbox. Then scroll down a bit further and clear the Hide protected operating system files (Recommended) checkbox. (You’ll have to click past a warning dialog box to make this change.) When you close the dialog box and return to the Explorer window, you’ll see all the files in that folder, including those marked as hidden and system files.

It is annoying to make this change, and equally annoying to undo the change when you’re finished with the current task. So for Windows XP Inside Out, we came up with a script that automates the process. The script examines the registry to see whether hidden files (those with the Hidden attribute set) are displayed in Windows Explorer. If not, it modifies the registry so that hidden files and super-hidden files (those with the System and Hidden attributes set) are displayed. The script also assumes that you probably want the option to edit file name extensions, so it changes settings to make all file name extensions visible as well. If hidden files are already displayed, the script assumes you want to undo the previous set of changes and modifies these three registry values accordingly.
I’ve made the script file available for download in compressed (Zip) format: Click here to download the file, extract it to a convenient location, and run it whenever you want to toggle hidden files.
If you want to view the script contents first, click here to see the text in a separate browser window. Remember to save the script file with the .vbs extension.
When the script runs, it changes the current settings and displays the results in an information box. If the script won’t run properly on your computer, check to see whether your anti-virus or security software is blocking Visual Basic script files.

Simon, this tip was written before the launch of 64-bit Windows XP, so it doesn’t reflect that product. I honestly have no idea how to make it work, and don’t have the time to research it. Sorry.
Cheers, nice trick. Works in Vista Ultimate 64-bit too btw.
Script works great for me on VISTA ! Thanks !
Hi Sir:
May I ask if you had the chance to look into answer #21 above. Thanks.
20. Simon H says:
Hi,
I’ve tried this script, and it does change the values it is supposed to in the registry, but the change isnt reflected in explorer, not even after pressing F5, switching folders or restarting explorer. The change only comes into place if i go tools>folder options, select the view tab then click OK, then press F5. Any ideas how to get around this? I’m using XP x64 Pro if that helps.
Thanks, Simon
21. Ed Bott says:
Simon, this tip was written before the launch of 64-bit Windows XP, so it doesn’t reflect that product. I honestly have no idea how to make it work, and don’t have the time to research it. Sorry.
Posted April 29, 2007 @ 9:12 am
Simon, as far as I’m concerned, XP 64 is an incomplete and orphaned product and I don’t have the resources to research it. If you’re serious about 64-bit computing on Windows, you really should be running Vista x64, period.
Thanks. My question was nicely written by others and you have already answerd and indicated in #20 + #21. However, thanks for answering it again.
My PC uses XP and the confusing thing is that your approach refresh and is in agreement with one of MS’ articles. I guess that what MS called Refresh (Right Click on Desktop and Press Refresh) is not really the same Refresh as yours. Probably, MS Refresh is something else but MS calls it (whatever that is) Refresh anyhow.
Is there a way to do using VB what one of your readers raised … that is: to update the PC screen, or re-apint the screen, or update the list of folders in the Windows Explorer (files & subfolders)? I feel that is the solution.
Thanks
Code:
WS = CreateObject(”WScript.Shell”)
WS.RegWrite(”HKCU\SYSTEM\CurrentControlSet\Control\Update\UpdateMode”, 0, “REG_DWORD”)
does not update the screen “immediately.”
why? or how to update the screen immediately?
Thanks
thanx 4 the script! i owe u one!…
Greetings,
Are any of your members willing to supply what I’ve been unable to locate for myself? (Before proceeding further, I should add that, not only am I not a member, at a week away from my sixtieth birthday, I feel I am just a little long in the tooth to start learning new tricks). Anyway, what I’m seeking is a script that will emulate/call upon the mouse right-click refresh command in Windows Explorer (Windows XP Pro File Manager). Please note that neither “F5″ nor “Ctrl+R” are satisfactory since they are more than a little spasmodic in their responses, so I assume that the mouse command is calling upon a different function.
The reason for desiring this script is that I’d appreciate a more elegant alternative to my existing system. Thanks to Google (and its creator, of course), I’ve found a script that will toggle “Show/Hide File Extensions”. This operates practically instantaneously but its effect cannot be seen until the window is refreshed (repainted?). I’ve tried various things to complete the change smoothly, none of which have been successful (NirCmd and modifying the Registry amongst others).
At present, I’m using an executable (created from a macro) to show the change, but this relies on the Explorer window being in a central position and the area beneath the called-for mouse position being blank. The command file runs from a shortcut on the Quick Start bar that in turn runs a two-part command, the first part being the extension toggle script and the second, the refresh executable.
(If it’s of any assistance, the toggle script I’m using, slightly modified to remove its original message panes, is:
Option Explicit
Dim RegValue, strFileExtKey
Dim strKey, WshShell
On Error Resume Next
strKey = “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced”
strFileExtKey = strKey & “\HideFileExt”
Set WshShell = WScript.CreateObject(”WScript.Shell”)
RegValue = WshShell.RegRead(strFileExtKey)
If RegValue = 1 Then
WshShell.RegWrite strFileExtKey, 0, “REG_DWORD”
WshShell.Run “%windir%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters”, 1, True
Else
WshShell.RegWrite strFileExtKey, 1, “REG_DWORD”
WshShell.Run “%windir%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters”, 1, True
End If
)
So, can you help me? I appreciate that my needs are far from urgent but I’m enough of a “geek” to want things to be as neat as possible. Finally, I apologise for being somewhat long-winded (I plead my age as an extenuation!) but I wanted to ensure that there is no confusion about exactly what it is I’m searching for.
With grateful thanks in advance,
Dave Weightman
hey is there a way to integrate this script in the right-click menu? or just make a keyboard shortcut for it? thanks
Amazing Script
Thank’s for Ed Bott
thanks for the scripts! just wat i needed!
Noob: To make a keyboard shortcut, first create a shortcut to the script file (drag it with right mouse button and select create shortcut) then right click on that shortcut, and select properties. There will be a entry area labled “Shortcut key” select it and hit your desired button.
As to the right click menu, it is possable but I would need to know what exactly you mean (As in what exactly you are right clicking on)http://www.jfitz.com/tips/rclick_custom.html
Now… on to MY question.
I can edit the script to only toggle the show hidden files & folders, but I want modify the script to change the icon of it’s shortcut (we’ll assume it’s on the desktop) to be either a folder (when showing hidden) or a transparent icon (when hideing) thereby giveing me a visual que of if hidden is toggled ON or OFF before I run the file. Can anyone assist?
Dave: Check the sight I listed above for context info to research what right click refresh is actualy calling up. I think the right click refresh is more akin to closeing the folder and reopening it. I don’t recall how to determine what windows explorer has open and it would take some research to accomplish smoothly, therefore I’ll wait for another more recent request before I look into it that deeply.
First off, This must be the longest tip of the day, over 3 yrs !
Ed , your a life saver, I’m always in and out of the ”hidden” system as I use the desktop.ini file to control my customised folder icons.
I haven’t a clue why this started happening but all of a sudden (i.e. yesterday a.m) if I tried to hide/show either files or extensions as soon as I hit the ”apply” tab my PC froze with the only way out was the good old power off button.
Any ideas why this would suddenly start happening ?
This is am amazing script. I have been looking for this script for one long time. Thanks A Million.
*cool*