Reputation: 11560
To show/hide hidden files/folders in windows OSes like XP, Vista or Seven, we have to...
Is there any dos command/batch script to do this? I just want to make it done using single click(whether it is .bat file or anything).
I searched and found an answer for the files affected by viruses - Windows batch script to unhide files hidden by virus - but it is specific for a single drive user has entered- and that too, for affected by virus.
I also found the change needed in registry for this.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"Hidden"=dword:00000001
"HideFileExt"=dword:00000000
I am new to registry editing thing. So I don't know how to do this stuff.
So, how can I make it happen - at a single click - I can enable/disable viewing hidden files and folders?
Upvotes: 2
Views: 10900
Reputation: 11
A possibly more convenient way to accomplish this with minimal effort is through adding a context menu item, to do this:
Open it with notepad and paste the following:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Windows.ShowHiddenFiles]
"CommandStateSync"=""
"Description"="@shell32.dll,-37573"
"ExplorerCommandHandler"="{f7300245-1f4b-41ba-8948-6fd392064494}"
"MUIVerb"="@shell32.dll,-37572"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Windows.ShowHiddenFiles]
"CommandStateSync"=""
"Description"="@shell32.dll,-37573"
"ExplorerCommandHandler"="{f7300245-1f4b-41ba-8948-6fd392064494}"
"MUIVerb"="@shell32.dll,-37572"
save and close.
This is what you should get: Hidden Toggle
Source: https://winaero.com/blog/hidden-items-context-menu-windows-10/
Upvotes: 1
Reputation: 44
Upvotes: 0
Reputation: 1
This script worked great for me:
Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
SHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
Set Sh = WScript.CreateObject("WScript.Shell")
St = Sh.RegRead(Hidden)
If St = 2 Then
Sh.RegWrite Hidden, 1, "REG_DWORD"
Sh.RegWrite SHidden, 1, "REG_DWORD"
Else
Sh.RegWrite Hidden, 2, "REG_DWORD"
Sh.RegWrite SHidden, 0, "REG_DWORD"
End If
Sh.SendKeys("{F5}")
Upvotes: 0
Reputation: 37569
you might try this:
@echo off &setlocal
set "regkey=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
for /f "tokens=2*" %%a in ('reg query %regkey% /v Hidden^|find "REG_DWORD"') do set /a Hidden=%%b
for /f "tokens=2*" %%a in ('reg query %regkey% /v ShowSuperHidden^|find "REG_DWORD"') do set /a SSuperHidden=%%b
if "%hidden%"=="1" (set /a hidden=2, SSuperHidden=0) else set /a hidden=1, SSuperHidden=1
reg add %regkey% /f /v Hidden /t REG_DWORD /d %hidden% >nul
reg add %regkey% /f /v ShowSuperHidden /t REG_DWORD /d %SSuperHidden% >nul
for /f "tokens=2*" %%a in ('reg query %regkey% /v Hidden^|find "REG_DWORD"') do set /a Hidden=%%b
<nul set /p="System files and folder are "
if "%hidden%"=="1" (echo NOT hidden.) else echo hidden.
endlocal
PAUSE
You must update the explorer by yourself by pressing F5. To do this by script you need vbscript.
Upvotes: 3