Windows 變更使用者密碼 GUI.ahk

Windows 變更使用者密碼 GUI.ahk

是否有一個 Windows 命令(透過命令列發送)可以打開「更改密碼」窗口,如下所示。

答案1

control userpasswords2

上述命令將開啟一個使用者窗口,您可以選擇重設密碼

使用者帳戶視窗

答案2

您可以嘗試以下幾件事。

微軟說control password.cpl應該可以從命令列運行,但我在非網域控制電腦上的 Windows 7 中無法獲得它。

使用該命令start control password.cpl也可能有所幫助。

這是另一個命令嘗試rundll32.exe shell32.dll,Control_RunDLL password.cpl

如果這些不起作用,您可以從命令列執行此操作net user [username] [newpassword]

答案3

我用了自動熱鍵為了這。

將變數更改user為目標用戶。

儲存檔案並在啟動資料夾中建立該檔案的捷徑。

每行末尾都有註釋以;供解釋。

Windows 變更使用者密碼 GUI.ahk

#NoEnv
SetWorkingDir %A_ScriptDir%
#Warn
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
SetTitleMatchMode Fast
DetectHiddenWindows Off
DetectHiddenText On
#WinActivateForce
#NoTrayIcon
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1
#Persistent
#MaxThreadsPerHotkey 2

WindowsChangeUserPasswordGUI:
user := "Administrator"  ; user
WinGetTitle, title, A  ; Active Window Enable On Top
WinGetClass, class, A  ; Active Window Enable On Top
WinGet, exe, ProcessName, A  ; Active Window Enable On Top
WinSet, AlwaysOnTop, On, %title% ahk_class %class% ahk_exe %exe%  ; Active Window Enable On Top
Run, netplwiz  ; User Accounts
WinWait, User Accounts ahk_class #32770 ahk_exe netplwiz.exe  ; User Accounts
WinSet, Transparent, 0, User Accounts ahk_class #32770 ahk_exe netplwiz.exe  ; Make User Accounts Window Transparent (Not Visible)
WinSet, AlwaysOnTop, Off, %title% ahk_class %class% ahk_exe %exe%  ; Active Window Disable On Top
ControlSendRaw, SysListView321, %user%, User Accounts ahk_class #32770 ahk_exe netplwiz.exe  ; Select Specified User
ControlGet, selected, List, Selected, SysListView321, User Accounts ahk_class #32770 ahk_exe netplwiz.exe  ; Get Selected User
selected := RegExReplace(selected, "\t.*", "")  ; Get Pure User Name, Remove User Groups
ControlClick, Button6, User Accounts ahk_class #32770 ahk_exe netplwiz.exe,, Left, 1,  NA  ; Reset Password Button
WinWait, Reset Password ahk_class #32770 ahk_exe netplwiz.exe  ; Reset Password
WinSetTitle, Reset Password ahk_class #32770 ahk_exe netplwiz.exe, , Reset Password %selected%  ; Set Window Title Reset Password User
WinGetPos, passX, passY, passW, passH, Reset Password ahk_class #32770 ahk_exe netplwiz.exe  ; Get Window Position Of Reset Password 
x := (A_ScreenWidth - passW) / 2  ; Set The Coordinates For Screen Center
y := (A_ScreenHeight - passH) / 2  ; Set The Coordinates For Screen Center
WinMove, Reset Password ahk_class #32770 ahk_exe netplwiz.exe,, %x%, %y%  ; Move Reset Password Window To Screen Center
WinWaitClose, Reset Password ahk_class #32770 ahk_exe netplwiz.exe  ; Wait For Reset Password Window To Close
WinClose, User Accounts ahk_class #32770 ahk_exe netplwiz.exe  ; Close User Accounts Window
ExitApp  ; ExitApp
Return

答案4

我不再在任何 Windows 電腦上看到 password.cpl;它可能已被棄用。然而,這個晦澀的命令似乎仍然可以用來啟動密碼對話框:

C:\Windows\explorer.exe shell:::{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}

希望它對您有用。

相關內容