Ctrl+Alt+H Toggle the whether hidden files are shown or hidden.
Ctrl+Alt+S Toggle the whether super-hidden system files are shown or hidden.
Ctrl+Alt+E Toggle the whether the file extensions for known file types are shown or hidden.
You can also toggle these options using the tray menu. The tray menu also shows which options are currently selected.
Note: In order to show the super-hidden system files, both Show Hidden Files and Show System Files must be selected. This is an OS restriction.
Works on both Win XP and Win 7.
Edit: 3-28-2013 - Removed AHK Basic support. Please use the current version of AHK.
Spoiler
/*
Platform: Win XP, Win 7
Author: rbrtryn
Script Function:
Show/Hide hidden folders, files and extensions in Windows XP and Windows 7
All of these system settings are found in the Windows Registry at:
Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
The specific values are:
Hidden Show hidden files? ( 2 = no, 1 = yes )
HideFileExt Show file extensions? ( 1 = no, 0 = yes )
ShowSuperHidden Show system files? ( 0 = no, 1 = yes )
In order to show protected system files Windows requires that both
the ShowSuperHidden and the hidden settings be set to yes, i.e. both set to 1
*/
#NoEnv
#LTrim
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode RegEx
GroupAdd ExplorerWindows, ahk_class ExploreWClass|CabinetWClass|Progman
global SubKey := "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
gosub MakeTrayMenu
return
; Toggle the show/hide of hidden files
^!h::
ToggleHiddenFilesStatus:
GetRegValue("Hidden") = 1
? SetRegValue("Hidden", 2)
: SetRegValue("Hidden", 1)
Menu Tray, ToggleCheck, Show Hidden Files`tCtrl+Alt+H
gosub UpdateWindows
return
; Toggle the show/hide of system files
^!s::
ToggleSystemFilesStatus:
GetRegValue("ShowSuperHidden")
? SetRegValue("ShowSuperHidden", 0)
: SetRegValue("ShowSuperHidden", 1)
Menu Tray, ToggleCheck, Show System Files`tCtrl+Alt+S
gosub UpdateWindows
return
; Toggle the show/hide of extensions for known file types
^!e::
ToggleFileExtStatus:
GetRegValue("HideFileExt")
? SetRegValue("HideFileExt", 0)
: SetRegValue("HideFileExt", 1)
Menu Tray, ToggleCheck, Show File Extentions`tCtrl+Alt+E
gosub UpdateWindows
return
About:
MsgBox, , About ShowHide,
(
This program will show/hide hidden files, system files
and file extensions via hotkey or tray menu.
The defined hotkeys are:
Ctrl+Alt+H Toggle the show/hide of hidden files
Ctrl+Alt+E Toggle the show/hide of file extensions
Ctrl+Alt+S Toggle the show/hide of system files
Works on both Windows XP and Windows 7
rbrtryn 2012
)
return
GetRegValue(ValueName) {
RegRead Value, HKCU, %SubKey%, %ValueName%
return Value
}
SetRegValue(ValueName, Value) {
RegWrite REG_DWORD, HKCU, %SubKey%, %ValueName%, %Value%
}
; Send a "Refresh" message to all of the Explorer windows including the Desktop
UpdateWindows:
Code := Is_In(A_OSVERSION, "WIN_XP", "WIN_2000") ? 28931 : 41504
WinGet WindowList, List, ahk_Group ExplorerWindows
Loop %WindowList%
PostMessage 0x111, %Code%, , , % "ahk_id" WindowList%A_Index%
return
MakeTrayMenu:
Menu Default Menu, Standard
Menu Tray, NoStandard
Menu Tray, Add, About, About
Menu Tray, Add
Menu Tray, Add, Default Menu, :Default Menu
Menu Tray, Add
Menu Tray, Add, Show System Files`tCtrl+Alt+S, ToggleSystemFilesStatus
Menu Tray, Add, Show File Extentions`tCtrl+Alt+E, ToggleFileExtStatus
Menu Tray, Add, Show Hidden Files`tCtrl+Alt+H, ToggleHiddenFilesStatus
Menu Tray, Default, Show Hidden Files`tCtrl+Alt+H
; If any of the menu items need to start off checked, take care of it here
if GetRegValue("Hidden") = 1
Menu Tray, Check, Show Hidden Files`tCtrl+Alt+H
if GetRegValue("ShowSuperHidden") = 1
Menu Tray, Check, Show System Files`tCtrl+Alt+S
if GetRegValue("HideFileExt") = 0
Menu Tray, Check, Show File Extentions`tCtrl+Alt+E
return
Error at line 22. Line Text: #Warn Error: This line does not contain a recognized action.
Error at line 29. Line Text: global SubKey := "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" Error: This line does not contain a recognized action.