Appreciate if anyone could give some advises on how to retrieve a value from registry to do comparison with a list of subfolder. Example as below:
Path in registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
From above path, it have 3 column with values:
Column [Name] : value [LastUsedUsername]
Column [Type] : value [REG_SZ]
Column [Data] : value [Administrador]
I want to get the value Administrador
from column Data
. Then with this value I need to compare with a list of subfolder, if this value exist in other subfolder, then it will export file in sub folder.
According to your provided information, the following will save the value data from your column to a variable:
@Set "VarName="
@For /F "EOL=HTokens=2*" %%G In ('^""%__AppDir__%reg.exe" Query ^
"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
/V "LastUsedUsername" 2^>NUL^"')Do @Set "VarName=%%H"
@If Not Defined VarName GoTo :EOF
Your code would continue on the very next line, where %VarName%
would be used for your comparison. I am unable to provide that for you at this time, because:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.