Vista users, please help me test a script

If you’re running Windows Vista, I’d like your help with a project.

More than two years ago, I published a simple script that allows you to toggle the Explorer attribute that shows and hides System and Hidden files. It was originally written for Windows XP, but I’ve been testing it lately on Windows Vista and it works just fine there as well – for me, anyway.

And that’s where you come in. If you’re running Windows Vista (any edition, 32- or 64-bit), I want you to try this script and see if it works for you.

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 file name extensions visible as well for common data file formats. 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 double-click to run it. (Double-click again to re-run the script and undo the changes.) You’ll see an informational dialog box that lists the current settings. (Note that you might have to press F5 or right-click and choose Refresh from the shortcut menu to see the changes reflects in an open Explorer window.)

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.

If you encounter any problems, please post a comment here.

18 thoughts on “Vista users, please help me test a script

  1. It worked for me except for sysprs7.dll ???

    The other mystery file – sysprs7.tgz – did lose it’s extention

    BTW what are these tics?

  2. Doug, I’ve never seen those files. A little Googling says they might be related to SPSS, but I didn’t go very deep. They could also be related to the Wild Tangent game software, which is bundled with some systems from Del and HP among others.

  3. It works wonderfully on this end. In fact, I’ve been wanting something like this for a long time.

    Suggested improvement: add to the right-click context menu for a folder?

  4. Ed

    I always set my computers to Show Extensions for Known File Types. This script removes that setting.

    Also, is it possible to use sendkeys (F5) to refresh the screen automatically?

  5. Freud, you can easily comment out the lines that change the extension behavior. I’m leery of sending the Refresh command because it only acts on the current window and I have no way of knowing which window is active at the time. Most of the time, I have multiple windows open, so I don’t know which one this would affect.

    Serdar, if you can figure out how to customize a context menu using a script I’ll be glad to modify it accordingly.

  6. Ed, what’s the point, just unhide the files. Vista has the critical files locked so you can’t do anything with them anyway. (Ive tried).

  7. Ed, works fine on Windows XP 32-bit/64-bit and Windows Vista 32-bit/64-bit on my quad-boot system. Also these setting affect applications other than Windows Explorer that inherit Explorer. I have an MP3 tag editor that does that.

    Personally, I never understood why, in the release Windows 2000, that Microsoft decided to hide file extensions and that some file attributes are “advanced.” I think it was the influence of the Apple guys they hired or maybe the Office guy responsible for the horrible Options dialog in Outlook. Do you know the history of this?

    And Microsoft used to claim that their User Interfaces were completely operable from either a keyboard or a mouse. Whatever happened to that?

  8. The script works fine for me (Vista Ultimate 32-bit).

    With Vista i’ve changed from always showing hidden files and folders to leaving them hidden; that keeps me from clicking on all the “My” shortcuts (that I guess are there for compatability with XP) out of habit.

    I also modified the script so that the dialog boxes read: “After clicking on OK Windows Explorer…” because the first time I ran the script to change back to not showing hidden objects I read “not” as “now” and got a little confused–my dumb mistake but I changed the script to keep me straight.

  9. Ray, hidden and system files make for a lot of clutter when you’re browsing. I prefer to have them hidden except when I need to work with them.

    Serdar, I know about that technique, but that is normally how you run a command on a specific file. I’ll poke around and see if I can make this technique work.

  10. Yeah, I thought it would something we could apply to manually running this script, but I imagine there is a more elegant solution.

  11. I have been using this script for quite some time and I love it. As someone previously mentioned, it would be extremely nice to have all explorer windows automatically refresh (including the desktop). I have played around with a few different approaches, but none of them were really what I was looking for. The sendkeys method doesn’t seem to cut the cheese. Has anyone managed to figure this one out?

  12. it doesnt seem to work for me thanks to a malicious virus messing arround with super hidden attributes… i cant find some files i know are in a folder… oh well never mind… if only i could uninstall explorer and reinstall… that’ll never happen

  13. Ed, I was messing with this lately and came up with the following inelegant (crass?) solution to the desktop refresh problem. I was surprised to realize how long ago it was when this post appeared. It seems like it was only last month! Anyway, this site was helpful to me:

    Here is my script:

    ‘ Toggle Explorer display: show/hide filename extensions.
    ‘ Tested with Windows XP

    Option Explicit
    Dim WshShell, d1, i
    On Error Resume Next
    Set WshShell = WScript.CreateObject(“WScript.Shell”)
    Set d1 = 90

    ‘ Open the Folder Options control panel to the display tab.

    WshShell.Run “RunDll32.exe shell32.dll,Options_RunDLL 0”, 0, True
    WScript.Sleep d1
    WshShell.SendKeys “^{TAB}”
    WScript.Sleep d1
    WshShell.SendKeys “{TAB}”

    ‘ Send eleven times to select “Show/Hide extensions”.

    For i = 1 to 11
    WScript.Sleep d1
    WshShell.SendKeys “{DOWN}”

    ‘ Activate the option, press Alt-A, and Escape.
    ‘ Desktop and folders should refresh automatically.

    WScript.Sleep 300
    WshShell.SendKeys ” ”
    WScript.Sleep 300
    WshShell.SendKeys “%A”
    WScript.Sleep 300
    WshShell.SendKeys “{ESC}”

  14. Anyone who wishes to run the above script please change all the curly double quotes to straight double quotes. Also change the curly single quotes to straight single quotes.

    WordPress coughed up a hairball when I posted this. I was pleasantly surprised to see it came out pretty well anyway.

    I realize this isn’t a site for code geeks. Surprising how little information is out there about this common scripting task (refreshing folders / desktop).

Comments are closed.