Try these ammendments :

call CreateUser() as this :

code:
$ = CreateUser ($Value1, $Value2, $Value3, $Value4)

CreateUser() should look like this (No error checking / untested)

code:
Function CreateUser ($Name, $FullName, $Desc, $pwd)

? "Creating Account..." ;don't know how this looks , but think it gets better commented out :D

;Create the objects Domain and User.

$Domain = GetObject("WinNT://CCC,domain")
$User = $Domain.Create("user", $Name)

;Set user account flags.

$User.FullName = $FullName
$User.Description = $Desc
$User.SetPassword = $pwd
$User.LoginScript = "logon.bat"
$User.Put ("PasswordExpired", 1)

$User.SetInfo

;Cleanup Objects Domain and User
$Domain = 0
$user = 0

? "ID complete"
EndFunction

hth

Jochen

[ 17. September 2002, 14:13: Message edited by: jpols ]
_________________________