Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing local user password

Status
Not open for further replies.

hamzazf

Programmer
Apr 17, 2013
4
0
0
MA
hello,
am new at programnig and i tried to change local user password by this code

strComputer = "MyComputer"
set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user")
objUser.SetPassword "0000"
objUser.SetInfo


and it dosent work
any suggestions
thank you.
 
yes

an error at
ligne :2
caract : 1
code: 80070035
source : (null)
 
i've made this change now i get another error
code: 800708AD
error: cannot find username
 
here the code now


strComputer = "."
set objUser = GetObject("WinNT://" & strComputer & ".")
objUser.SetPassword "0000"
objUser.SetInfo
i get this now
erora.png
 
Geates is correct.

If you are trying to change the password on the local machine, you should try the code below, you should run the script with admin priviliges, and you should make sure that an account called Administrator actually exists.

Code:
strComputer = "."
set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user")
objUser.SetPassword "0000"
objUser.SetInfo

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top