Windows命令行创建账号、加入管理员组、设置密码永不过期和禁止修改密码

阅读 73

2022-08-12

用以下批处理,把创建账号、加入管理员组、设置密码永不过期和禁止修改密码一次性完成。

用户是abc,密码是pass!

net user abc pass! /add /passwordchg:No
wmic.exe UserAccount Where Name='abc' Set PasswordExpires=false
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /f /v PasswordExpires /t REG_SZ /d "C:\\Windows\\System32\\wbem\\WMIC.exe UserAccount Where Name='abc' Set PasswordExpires=false"

精彩评论(0)

0 0 举报