使用命令行复制/粘贴用户SID? [英] User SID copy/paste using command line?
本文介绍了使用命令行复制/粘贴用户SID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以仅从命令行(Windows 7)从注册表(或其他方式)复制用户SID并将其粘贴到txt文件?
Can user SID be copied from registry (or whatever) and pasted to a txt file using command line only (Windows 7)?
推荐答案
通过WMIC
wmic useraccount where name='%username%' get sid | findstr /b /C:"S-1" > file.txt
通过WHOAMI(如果在批处理文件中使用,则重复百分号)
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
这篇关于使用命令行复制/粘贴用户SID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文