|
- for /f "skip=1 takens=3" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%usid%" /v ProfileImagePath') do set "u_dat=%%a"
复制代码
这句直接就是错别字,应该改为:
- for /f "skip=1 tokens=3" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%usid%" /v ProfileImagePath') do set "u_dat=%%a"
复制代码
reg unlod同理。
转义符号我不太会用,给个用临时文件的替代版本。wmic机制好像比较特殊,不能用常理考虑。
- wmic useraccount where name="%user1%" get sid | findstr /b S- > "%TEMP%\tmp-123456.txt"
- for /f "usebackq" %%i in ("%TEMP%\tmp-123456.txt") do SET USID=%%i
- del /s /q /f "%TEMP%\tmp-123456.txt" >nul
复制代码 |
|