Query Show & Hide Hidden File and Folder Setting

Created to return whether files and folders that are hidden can be seen or not.

rem Returns whether files are hidden or not

@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
if “%hidden%”==”1” (echo NOT hidden.) else echo hidden.
endlocal
PAUSE

email me