Code: Select all
HKEY_LOCAL_MACHINE\Software\1234567890\123\WinPE\BoundOperatingSystem\HKEY_USERS
S-1-5-21-974480208-2472847273-1695335269-1000 REG_SZ S-1-5-21-974480208-2472847273-1695335269-1000
S-1-5-21-974480208-2472847273-1695335269-1000_Classes REG_SZ S-1-5-21-974480208-2472847273-1695335269-1000_Classes
End of search: 2 match(es) found.
Batch file code:
Code: Select all
For /F "Skip=2 Tokens=3" %%A in ('REG QUERY "HKLM\Software\1234567890\123\WinPE\BoundOperatingSystem\HKEY_USERS" /f S-1-5*-1000 /d') Do (
Set pn=%%A)
Result of the batch file:
Code: Select all
G:\>(Set pn=S-1-5-21-974480208-2472847273-1695335269-1000 )
G:\>(Set pn=S-1-5-21-974480208-2472847273-1695335269-1000_Classes )
G:\>(Set pn=search: )
What I need is the value without the "_classes". As you can see, it sets it right the first time, but then changes the value two more times. Any way to just have it do the one?