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}

お役に立てれば幸いです。

関連情報