Set local user Password with VB6

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

MERCOMMSAsked:
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
http://support.microsoft.com/kb/187535
It says it is for use on Windows NT or Windows 2000, but I am pretty sure it will work the same for >= XP.
0
 
RDWaibelCommented:
are you talking about the Computer's Login password?
0
 
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.
0
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
0
 
RDWaibelCommented:
I agree Brook.  
Not something I would do for sure.
0
 
MERCOMMSAuthor Commented:
AS Info to all, it does work with XP Pro SP3
0
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.