Toggling Hidden files or folders in Windows 7

To toggle hidden files/folders in windows, open notepad and paste:

Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
Set Command1 = WScript.CreateObject("WScript.Shell")
Set command2 = CreateObject("Wscript.Shell")
Check = Command1.RegRead(Hidden)
If Check = 2 Then
Command1.RegWrite Hidden, 1, "REG_DWORD"
Else
Command1.RegWrite Hidden, 2, "REG_DWORD"
End If
Command1.SendKeys "{F5}"

and save it as “Toggle Hidden files.vbs” and cut and paste the file into a root location like C:\windows. Create a shortcut to the file and give it a shorcut key like “ctrl+shift+H”.
Cut and paste this shortcut into

C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

Note:where [username] is the username of your account.

Now after you restart your computer, everytime you press the shorcut key AND refresh the explorer window, windows will either show or hide the hidden files/folder.

(also this only shows basic hidden files not system protected hidden. If you wish to toggle both basic and system protected then use this code for the .vbs:

Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
SSHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
Set Command1 = WScript.CreateObject("WScript.Shell")
Set command2 = CreateObject("Wscript.Shell")
Check = Command1.RegRead(Hidden)
If Check = 2 Then
Command1.RegWrite Hidden, 1, "REG_DWORD"
Command1.RegWrite SSHidden, 1, "REG_DWORD"
Else
Command1.RegWrite Hidden, 2, "REG_DWORD"
Command1.RegWrite SSHidden, 0, "REG_DWORD"
End If
Command1.SendKeys "{F5}"

Reference and thanks to Dr. Abhishek Ghosh
http://thecustomizewindows.com/2011/04/add-showhide-hidden-files-option-to-right-click-context-menu/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s