Quote:

Code:
function SetPassword( $userID, $password, optional $computer )
dim $objUser

if not $computer $computer = "." endif

$objUser = GetObject("WinNT://" + $computer + "/" + $userID + ",user")
if [b]@error[/b] exit 1 endif

;-- Set the password for the account --
$objUser.SetPassword( $Password )
$objUser.SetInfo()
If [b]@error[/b]
exit 2
Else
exit 0
EndIf
endfunction

if you don't have the RenameUser tool, you could try this function.




I've saved the code to SetPassword.kix, now if I want to change the password, will this work??

====reset.kix=====
Code:

Call 'D:\KIX\UDF\SetPassword.kix'

SetPassword('admin','test','computer')