在导出以下命令期间,所有值都是十六进制值,即使在Reg Editor中它也显示为普通字符串。
特别是ProfileImagePath
REG Export "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
“
Reg Editor =
`Name` `Type` `Data`
ProfileImagePath
REG_EXPAND_SZ
C:\Users\ABC
导出后,它显示为=(稍微更改了六角值)
"ProfileImagePath"=hex(2):43,00,3a,00,3a,5c,55,00,73,00,65,00,72,00,73,00,5c,\
6b,65,00,72,00,61,00,6e,00,61,00,00,64,2e,00,64,00,65,00,65,61,70,00,61,00,\
2b,00,00,2a
要求是,Data
ProfileImagePath
的值应存储在变量中。如果有多个用户(多个SID),则使用line作为分隔符存储在同一变量中。
答案 0 :(得分:0)
呃???????
C:\Users\User>reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
ProfilesDirectory REG_EXPAND_SZ %SystemDrive%\Users
Default REG_EXPAND_SZ %SystemDrive%\Users\Default
Public REG_EXPAND_SZ %SystemDrive%\Users\Public
ProgramData REG_EXPAND_SZ %SystemDrive%\ProgramData
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-18
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-19
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-20
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-21-2820837959-2753176274-143444667-1000
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-21-2820837959-2753176274-143444667-1006
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-21-2820837959-2753176274-143444667-1009
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-
5-21-2820837959-2753176274-143444667-500
或
for /f "tokens=7 delims=\" %A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"') do echo %A