1
votes

I am looking for a way to change the windows password throgh a python script.
somthing like a win32api that can help me?
Thanks!

1
You first need to fiquere out where the password is stored. Then modify that file, if that is possible. - Tenzin
What do you mean by "the windows password"? Are you referring to a password on a user account? - MrEricSir
@Tenzin No, that's not how to do this. The correct way would be with an API function if it existed. - David Heffernan
@MrEricSir - I'm talking about windows user password. - Shawn
@DavidHeffernan - Do you know such a function? - Shawn

1 Answers

1
votes

You can do this with the Win32 function NetUserChangePassword. From Python you can access that with win32net.NetUserChangePassword.

Although as the documentation points out this won't work if you are using active directory. But in that case you are surely not in a position to change user passwords programmatically.