Set local user Password with VB6

How would you go about setting a user password using VB6 if the current password is not known?

Who is Participating?
KarenConnect With a Mentor Analyst programmerCommented:
First off, you would need to be running with administrator privileges. Also note that changing a users window login can break other 'stored secrets' that the user may have, such as saved email passwords.

To update the password without knowing the old password you can use the NetUserSetInfo API.
For a code example see
It says it is for use on Windows NT or Windows 2000, but I am pretty sure it will work the same for >= XP.
are you talking about the Computer's Login password?
MERCOMMSAuthor Commented:
A local users password.

Just like you would do from the computer Management plug in when you right click on a user and select set password.
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Brook BraswellApplication Development ManagerCommented:
Sounds too intrusive for an application to set the desktop users password
I agree Brook.  
Not something I would do for sure.
MERCOMMSAuthor Commented:
AS Info to all, it does work with XP Pro SP3
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.