To set userflags, you have to do a put on the property. I've taken the liberty to modify your code...

code:
; UserFlag Constants....
; SCRIPT = &1
; ACCOUNTDISABLE = &2
; HOMEDIR_REQUIRED = &8
; LOCKOUT = &10
; PASSWD_NOTREQD = &20
; PASSWD_CANT_CHANGE = &40
; ENCRYPTED_TEXT_PASSWORD_ALLOWED = &80
; TEMP_DUPLICATE_ACCOUNT = &100
; NORMAL_ACCOUNT = &200
; INTERDOMAIN_TRUST_ACCOUNT = &800
; WORKSTATION_TRUST_ACCOUNT = &1000
; SERVER_TRUST_ACCOUNT = &2000
; DONT_EXPIRE_PASSWD = &10000
; MNS_LOGON_ACCOUNT = &20000
; SMARTCARD_REQUIRED = &40000
; TRUSTED_FOR_DELEGATION = &80000
; NOT_DELEGATED = &100000
; USE_DES_KEY_ONLY = &200000
; DONT_REQUIRE_PREAUTH = &400000
; PASSWORD_EXPIRED = &800000
; TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = &1000000


; User to create
$UserName = "Test"

; Password to set for the user
$UserPass = "secret"

; Computername to create the account on
$TargetPC = "TESTNAME"

; Bind to the remote machine
$Object = GetObject("WinNT://$TargetPC")

; Create the user on the remote machine
$Create = $Object.Create("User",$UserName)

; Set the password for the user
$Create.SetPassword($UserPass)

; Disable the User Must Change Password at Next Logon flag (value 0 = off, 1 = on)
$Create.PasswordExpired = 0

$UserFlags = &40 + &10000 ; User cannot change pswd + pswd never expires
$Create.Put("UserFlags",$UserFlags)

; Apply changes currently in cache
$Create.SetInfo

$group = GetObject("WinNT://"+$TargetPC+"/Administrators")
$group.Add($Create.ADSPath)

Exit

I took out the 'extra' SetInfo's. You only need to do that once, not each time you set a new property.

[ 28. November 2002, 15:44: Message edited by: Chris S. ]