以下命令可以實現在命令行中設置用戶屬性為密碼永不過期(需要安裝wmic.exe環境,執行命令時,請將半角雙引號中的“用戶名”換成實際的用戶名,windows7中驗證通過):
wmic.exe UserAccount Where Name="用戶名" Set PasswordExpires="false"
SX用戶密碼永不過期wmic.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"PasswordExpires"="C:\\Windows\\System32\\wbem\\WMIC.exe UserAccount Where Name='SX' Set PasswordExpires=false"