Sunday, July 17, 2011

How to Show/Hide Hidden Files With VB Scripting

Have you ever wanted a quick way to enable/disable your hidden files instead of having to go to explorer and hit tools then hit folder options ect every time! Well with this simple little script you don't have to! All you need to do is copy this code and paste it in a text file named "Anything.vbs" and if u have rocket dock or any other docklet program just make a shortcut to it drag and drop it on ur dock and there you go.


VB Script:




Option Explicit
Dim dblHiddenData, strHiddenKey, strSuperHiddenKey
Dim strKey, WshShell
On Error Resume Next
strKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
strHiddenKey = strKey & "\Hidden"
strSuperHiddenKey = strKey & "\ShowSuperHidden"
Set WshShell = WScript.CreateObject("WScript.Shell")
dblHiddenData = WshShell.RegRead(strHiddenKey)
If dblHiddenData = 2 Then
WshShell.RegWrite strHiddenKey, 1, "REG_DWORD"
WshShell.RegWrite strSuperHiddenKey, 1, "REG_DWORD"
WScript.Echo "Showing Hidden Files "
Else
WshShell.RegWrite strHiddenKey, 2, "REG_DWORD"
WshShell.RegWrite strSuperHiddenKey, 0, "REG_DWORD"
WScript.Echo "Hidding Files "
End if

No comments:

Post a Comment