[wpkg-users] A few quick questions

heiko.helmle at horiba.com heiko.helmle at horiba.com
Fri Jul 2 08:13:23 CEST 2010


> Also, what is the best way to use wpkg to change the administrator 
> account password on windows xp and vista?

I don't know the best way - i used a variant of a vbscript Dr.Google found 
for me. If you have powershell installed on XP I'd suggest you use that 
instead - it's much more readable. But VBScript has the advantage on being 
installed on every supported PC-Windows by default.

It also activates the administrator and disabled expiration. Note that 
this snippet only works on Windows-Versions where the admin-user is called 
"Administrator". If you use French, for example, you have to use 
'Administrateur':

dim PW
PW = "myPassword"
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
dim objUser, objUserFlags, objPasswordExpirationFlag
set objUser = GetObject("WinNT://./Administrator")
objUser.AccountDisabled = false
objUserFlags = objUser.Get("UserFlags")
objPasswordExpirationFlag = objUserFlags OR ADS_UF_DONT_EXPIRE_PASSWD
objUser.Put "userFlags", objPasswordExpirationFlag 

objUser.SetPassword PW
objUser.SetInfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20100702/4af4b386/attachment-0002.html>


More information about the wpkg-users mailing list