There was a situation where it was necessary to get the Security Identifier (SID) of Windows without using third-party software and VB. Through the command line it turned out quite real, we created a bicycle.
@echo off dir "%SYSTEMROOT%\system32\appmgmt" /A>SID_DIR.txt findstr /R S-.* "SID_DIR.txt">SID_STR.txt for /f "tokens=5" %%A in (SID_STR.txt) do (@echo %%A>SID.txt) del /f /q SID_DIR.txt del /f /q SID_STR.txt