Subscribe to How-To Geek

Keyboard Ninja: Toggle Hidden Files with a Shortcut Key in Windows

We've written a very long time ago about how to toggle hidden files in Ubuntu with a simple shortcut key. But what about keyboard ninjas using Windows instead? After doing some research, I've got a simple downloadable solution for you.

What I've done is throw together a very simple application that runs in the background and assigns the hotkey Win+H to toggle hidden files. There's no user interface to keep it from wasting memory, but you can always customize it using the AutoHotkey script provided below instead.

Note: This application was based on an AutoHotkey script created by Lifehacker commenter turnersd, fully credited below.

Toggle Hidden Files

Once you've downloaded and run the application, all you have to do is hit the Win+H shortcut key while you have any folder open:

image

And presto! You'll immediately see any hidden files in that folder, or any folders that are open.

image 

Hit the same hotkey sequence again, and the hidden folders will disappear again. Very useful!

Installing the Hotkey

In order to install this and set it up to run at startup, you'll need to save and extract the downloadable file, and then create a shortcut in your startup group, which you can easily access by typing the following into the location bar:

shell:startup

You could even just copy the executable in… but either way, once you've done that, you can double-click on it to start it.

image

Note that there's no UI for this application, it runs completely in the background to limit memory usage as much as possible.

Killing the Process

Because there's no UI, if you want to stop the application from running, you'll need to either reboot… or use the much simpler method of opening Task Manager, finding the ToggleHiddenFiles.exe process and killing it.

image

Using the AutoHotkey Script Instead

The method for creating the hotkey isn't something that I can take credit for… the credit should be fully given to Lifehacker commenter turnersd in this article about toggling hidden files with a shortcut.

Here's the source code, which you can copy into an AutoHotkey script file:

; WINDOWS KEY + H TOGGLES HIDDEN FILES
#h::
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
If HiddenFiles_Status = 2 
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
Else 
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
WinGetClass, eh_Class,A
If (eh_Class = "#32770″ OR A_OSVersion = "WIN_VISTA")
send, {F5}
Else PostMessage, 0×111, 28931,,, A
Return

If you have problems with this source, you can also grab it from the textsnip site.

Downloadable Application

Just remember to extract this file and save it somewhere where it won't be deleted later. I usually create a folder under my user directory for applications and save them there.

Download ToggleHiddenFiles Hotkey Application

The Geek is the founder of How-To Geek and a geek enthusiast. This article was written on 11/4/08 and tagged with: Keyboard Ninja

Daily Email Updates

You can get our how-to articles in your email inbox each day for free. Just enter your email below:


Comments (6)

  1. milnerw

    My fellow Geek,

    I have been using a shortcut similiar to the one you just described. the only real difference is it does not contain a hotkey. I can't remember where exactly I found it (it may have been on the ObjectDock website). It is just an executable that you create a shortcut for. when you click on it, it switches back and forth between hidden and unhidden. I have also included the icon i use for my shortcut.

    I'm not sure if this helps you our or not but here it is anyway.

    Download Link
    http://gtswebhosting.com/share....._Files.rar

  2. Kevin Luechtefeld

    Is there any way to do this in Windows XP?

  3. The Geek

    @Kevin

    It should work fine in any version of Windows.

  4. GTD Wannabe

    There's some kind of error in your ahk script, but the version I got from the link works perfectly. In WinXP.

  5. hansbkk

    Yes, Unicode characters mess things up if you copy and paste from here, but the textsnip service is great - thanks for that too!

    Works fine in XP.

    If you're running normal AHK mode, you can launch the .AHK file however you usually do, then right-click on the toolbar icon to exit the script.

  6. llamaman

    Now if there were only a way to show hidden files with a hotkey in programs (i.e. Microsoft Access).


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Sponsored Links
Getting Started
About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
Cmd.exe
Dpupdchk.exe

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.