.bat file to change windows password

Reference Image

Is there a way to automate the process of changing the windows password using a .bat file. The traditional way of changing the password will be like. Open Command Prompt, type net user Username * > press Enter key > Type New Password and Retype the New Password to confirm.

2

1 Answer

You could use this:

@echo off
net session >nul 2>&1 || (powershell start -verb runas '"%~0"' &exit /b)
net user {Username} {NewPassword}

Change {Username} by the username which password you would like to change and {NewPassword} with the new password.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like