BoardBabe Posted January 13, 2006 Posted January 13, 2006 How can I see how many subkeys are under a certain key in the registry?I'd like to see how many domains ive blockedHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
Doc Symbiosis Posted January 13, 2006 Posted January 13, 2006 The following batch should do the trick ( couldn't really test it, cause there's only one subkey on my machine:@echo offsetlocal enableextensionsset count=-3For /F %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"') Do call :increaseecho Blocked Domains: %count%:increaseset /A count=%count%+1goto :EOFendlocal
Yzöwl Posted January 14, 2006 Posted January 14, 2006 works well enough for me like this@echo offsetlocal enableextensionsset count=-3For /F %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"') Do call :increaseecho Blocked Domains: %count%endlocalgoto :eof:increaseset /A count=%count%+1goto :EOFHere is my alternative version@echo off&setlocal enableextensions&mode 30,2&color e5&title Script By Yz”wlset "key=\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"&set "count=0"for /f "tokens=*" %%? in ('REG QUERY "HKLM%key%" /s^|find "%key%\"^2^>nul') do if errorlevel 0 echo/%%~nx?|findstr/v "[.]">nul 2>&1||set/a count+=1echo/ You have %count% Blocked Domains&ping -n 6 127.0.0.1>nul&endlocal&goto :eofshould be four lines
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now