CODE: [Copy to clipboard]@echo off for /f %%i in ('reg query "hklm\sam"^|find /c /i "group"') do ( echo %%i set /a t=%%i set /a t+=1 call reg add "hklm\sam\group%%t%%" ) pause