User SID copy/paste using command line?

*爱你&永不变心* 提交于 2019-12-13 06:18:02

问题


Can user SID be copied from registry (or whatever) and pasted to a txt file using command line only (Windows 7)?


回答1:


Via WMIC

wmic useraccount where name='%username%' get sid | findstr /b /C:"S-1" > file.txt

Via WHOAMI (duplicate percent signs if used in batch file)

for /F "tokens=2 delims=," %f in ('whoami /user /FO CSV /NH') do echo %~f > file.txt


来源:https://stackoverflow.com/questions/19766590/user-sid-copy-paste-using-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!