@ECHO OFF set regpath=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced set regvalue=Hidden set regdata=2 reg query "%regpath%" /v "%regvalue%" | find /i "%regdata%" IF errorlevel 1 goto :hide Reg add "%regpath%" /v Hidden /t REG_DWORD /d 1 /f Reg add "%regpath%" /v HideFileExt /t REG_DWORD /d 0 /f Reg add "%regpath%" /v ShowSuperHidden /t REG_DWORD /d 1 /f goto :end :hide Reg add "%regpath%" /v Hidden /t REG_DWORD /d 2 /f Reg add "%regpath%" /v HideFileExt /t REG_DWORD /d 1 /f Reg add "%regpath%" /v ShowSuperHidden /t REG_DWORD /d 0 /f :end