【问题标题】:User SID copy/paste using command line?使用命令行复制/粘贴用户 SID?
【发布时间】:2013-11-04 11:15:58
【问题描述】:

是否可以仅使用命令行从注册表(或其他)复制用户 SID 并粘贴到 txt 文件(Windows 7)?

【问题讨论】:

    标签: command-line cmd sid


    【解决方案1】:

    通过 WMIC

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

    通过 WHOAMI(如果在批处理文件中使用,则重复百分号)

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

    【讨论】:

      猜你喜欢
      • 2011-11-25
      • 1970-01-01
      • 1970-01-01
      • 2015-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多