Jump to content

Free library for resetting windows password?


clariceo0
 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

@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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 3 weeks later...
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
Link to comment
Share on other sites

  • 1 year later...
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
Link to comment
Share on other sites

  • 3 weeks later...
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
Link to comment
Share on other sites

  • 1 year later...
  • Developers
32 minutes ago, Seemyu said:

This problem still occurs today,but reset password from Windows is not hard.

This is now the second post that is totally useless:

 

STOP that and only post when you have a question or something meaningful to say!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

×
×
  • Create New...