***Lines that dont begin with 2 spaces have wrapped accidentally***
@echo off
for /l %%i in (1,1,12) do echo.
set /p user_name=Enter Username:
cls
reg query "HKLM\software\microsoft\windows nt\currentversion\profilelist"
/s >>"%temp%\reg_sid.txt"
findstr /n /i %user_name% "%temp%\reg_sid.txt">>"%temp%\sid_number.txt"
for /f "tokens=1 delims=:" %%i in (%temp%\sid_number.txt) do set
line_num=%%i
set /a line_num=%line_num% - 2
for /f "skip=%line_num% tokens=7 delims=\" %%i in (%temp%\reg_sid.txt) do
set sid=%%i &cls& goto :continue
:continue
if not %errorlevel%==0 set sid=Unable to find the username: %user_name%
for /l %%i in (1,1,12) do echo.
echo %sid:~0,-1%
for /l %%i in (1,1,11) do echo.
pause
del "%temp%\reg_sid.txt"
del "%temp%\sid_number.txt"
***Lines that dont begin with 2 spaces have wrapped accidentally***