Sign in to follow this  
Followers 0
clariceo0

Free library for resetting windows password?

8 posts in this topic

Recently, I am interested to build a windows app to reset Windows login password as a side off project. I am still a newbie in programming so i am not able to build the app from scratch. Is there any open source  project i could learn from on this?

Share this post


Link to post
Share on other sites



Hi, @clariceo0, welcome to the forum. A couple of questions to help us help you:

  • Are you looking to change the password from within the machine itself or remotely?
  • Are you doing this on domain computers, or just local users on local PCs?
  • Are you wanting to allow users to do this themselves (something sitting on the desktop they can click on), and if so do they have administrative rights to do so?

The more info you can provide us with, the better we can assist you, so we're not throwing out suggestions that may not work for your situation.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
12 hours ago, JLogan3o13 said:

Hi, @clariceo0, welcome to the forum. A couple of questions to help us help you:

  • Are you looking to change the password from within the machine itself or remotely?
  • Are you doing this on domain computers, or just local users on local PCs?
  • Are you wanting to allow users to do this themselves (something sitting on the desktop they can click on), and if so do they have administrative rights to do so?

The more info you can provide us with, the better we can assist you, so we're not throwing out suggestions that may not work for your situation.

 thanks for the great suggestion. I just want to change or reset the password of local account. I will write a GUI client for this to help normal users without much technical knowledge.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@clariceo0 Usually we follow more of a "teach a man to fish" motto rather than just handing folks scripts, but I had this one lying about. It should give you an idea how to proceed anyway; you will probably need to modify to your needs. Also you'll want to test heavily; it is an older script which I have not tested on Windows 10. Let me know if you have any questions:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>

Local $sUserName, $sPassword

$hGUI = GUICreate("Reset Local Password", 300, 300)
    GUISetState(@SW_SHOW)
    GUISetFont(11, 400, Default, "Arial")

    $lblUserName = GUICtrlCreateLabel("Username", 115, 10, 65, 30)
    $lblPassword = GUICtrlCreateLabel("Choose New Password", 75, 90, 150, 30)
    $lblVerify = GUICtrlCreateLabel("Verify New Password", 75, 170, 150, 30)

    $inpUserName = GUICtrlCreateInput(@UserName, 10, 40, 280, 30, $ES_CENTER)
    $inpPassword = GUICtrlCreateInput("", 10, 120, 280, 30, $ES_PASSWORD)
    $inpVerify = GUICtrlCreateInput("", 10, 200, 280, 30, $ES_PASSWORD)

    $btnGo = GUICtrlCreateButton("Change Password", 10, 250, 125, 35)
    $btnClose = GUICtrlCreateButton("Exit", 165, 250, 125, 35)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $btnClose
                ExitLoop
            Case $btnGo
                If GUICtrlRead($inpPassword) == GUICtrlRead($inpVerify) Then
                    $sUserName = GUICtrlRead($inpUserName)
                    $sPassword = GUICtrlRead($inpPassword)
                    _changePW($sUserName, $sPassword)
                Else
                    MsgBox(0, "Reset Local Password", "Passwords do not match!")
                EndIf
        EndSwitch
    WEnd

Func _changePW($UserName, $Password)
    $oUser = ObjGet("WinNT://" & @ComputerName & "/" & $UserName)
        If IsObj($oUser) Then
            $oUser.SetPassword($Password)
            $oUser.SetInfo
        EndIf
EndFunc

 

   Edit: Also, although you posted in a C++ forum you didn't specify that you need this done in C++/C. Are you just looking to get the job done, or do you have a language requirement that it needs to be coded in?

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@JLogan3o13 thanks for the help. I will figure out the code myself and port it into C++.  so i can build a GUI with QT.  I find a good example of the program called UUkeys. Here is the tutorial on how to reset windows password. that is exactly what i am looking for.

Edited by clariceo0

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

On ‎12‎/‎05‎/‎2016 at 7:40 AM, Aquarium said:
On ‎11‎/‎05‎/‎2016 at 3:29 AM, clariceo0 said:

Recently, I am interested to build a windows app to reset Windows login password as a side off project. I am still a newbie in programming so i am not able to build the app from scratch. Is there any open source  project i could learn from on this?

You can use the api fuction NetUserChangePassword.

#ifndef UNICODE
#define UNICODE
#endif
#pragma comment(lib, "netapi32.lib")

#include <stdio.h>
#include <windows.h> 
#include <lm.h>

int wmain(int argc, wchar_t *argv[])
{
   DWORD dwError = 0;
   NET_API_STATUS nStatus;
   //
   // All parameters are required.
   //
   if (argc != 5)
   {
      fwprintf(stderr, L"Usage: %s \\\\ServerName UserName OldPassword NewPassword\n", argv[0]);
      exit(1);
   }
   //
   // Call the NetUserChangePassword function.
   //
   nStatus = NetUserChangePassword(argv[1], argv[2], argv[3], argv[4]);
   //
   // If the call succeeds, inform the user.
   //
   if (nStatus == NERR_Success)
      fwprintf(stderr, L"User password has been changed successfully\n");
   //
   // Otherwise, print the system error.
   //
   else
      fprintf(stderr, "A system error has occurred: %d\n", nStatus);

   return 0;
}

 

 

Edited by Melba23
Removed ad link in quote

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

On 2016/5/13 at 9:19 AM, clariceo0 said:

@JLogan3o13 thanks for the help. I will figure out the code myself and port it into C++.  so i can build a GUI with QT.  I find a good example of the program called UUkeys. Here is the tutorial on how to reset Windows password. that is exactly what i am looking for.

If I could see this post earlier, my data recovery program wouldn't be that messy ,

I reinstalled an operating system , but I'm a beginner,

 

Edited by Qaskeer

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

On 2017/9/29 at 2:51 PM, Qaskeer said:

If I could see this post earlier, my data recovery program wouldn't be that messy ,

I reinstalled an operating system , but I'm a beginner,

https://www.tunesbro.com/reset-windows-7-password.html

I am so sorry to hear that , but you are not the only one . more and more beginners will reinstall the system when they encounter this problem ,

Actually, we can use some free ways to reset Widnows password ,

Edited by Eakkery

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      i am working on a application where if the flashing is success i get a window saying "SUCCESS" and if the flashing failed a window saying "FAILED" and i have to automatically identify pass or fail.the problem is both the windows are having the same control ID. how can i differentiate between both windows? so that i can make use of that in script for automation///
       
       
      Thanks
    • comtech80
      By comtech80
      Folks,
      I have an issue I've been trying to solve for a while, I'm trying to add static routes in DHCP via a 121 route rule in Windows 2012 R2 is a brutal manual process and wanted to automate this via AutoIT.
       
      When I use the "ControlGetText" everything displays properly in the MSG box but when I try and use "ControlSetText" or "ControlSend" the values won't display in the input box but the action comes back as successful?
      Anyone able to help me with this? I'm thinking this might be an active window issue but i'm not sure.
      Here is a part of my code.
       
      $hWnd = WinWait("[TITLE:Add a Static Route]","", 10)
      WinActivate($hWnd)
      $Status = ControlSend($hWnd, "", "[CLASS:Edit; INSTANCE:4]", "192"); Does not add 192 to the text box.
      Local $sTextEdit1 = ControlGetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]")
      ConsoleWrite ( "ControlSend Status: " &  $Status & @CRLF); Returns a Value of 1
      ConsoleWrite ( "ControlGetText Value Edit1: " &  $sTextEdit1 & @CRLF);
       
      Please see attachment for more info.

    • lganta
      By lganta
      Hello!
      I created some scripts for a simple farming bot a few years ago and they rely on ControlSend.
      A year ago I quit that game and then installed Windows 10 (was using windows 7).
      Recently I installed that game and tried running them again and they seem to work (I have some messages displayed on the screen with the state of the bot ), except for the ControlSend part (which obviously is crucial).
      I started debugging the scripts so I created a basic script that makes use of Send. I tested this with Notepad in focus and works just fine and then with my game window in focus and it didn't work (it's supposed to write that text in an input box from the game).
      #include <MsgBoxConstants.au3> Sleep(3000); Send("some text"); MsgBox($MB_OK, "Notification", "Control was sent!");  
      Is there a way for the creators of the game to create some kind of security system against this? Or something happens because I updated to Windows 10?
      Is there something I'm missing?
      Thank you!
    • VIP
      By VIP
      I can not do anything with any user in the "Local Users Group"
      I tried from my account but I could not change my password (ie set new password)!
      But I was able to activate the Administrator account and I logged into the Administrator account and still could not do anything with my account! But I can set the password and disable the Administrator account from my account or Administrator.
      Any ideas? (Ignore the click on the Sign-in option in the Change Accout settings.)
       

    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      I have a question
      about the display language of the system
      How can I get the current display language and how can I change it by autoit
      Of course, if this is possible
      Greetings to all and hope you help me