Create a local user account (VBScript)

This code can be found in Chapter 15 of Windows XP Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' From the book "Windows XP Cookbook"
' ISBN: 0596007256

' ------ SCRIPT CONFIGURATION ------
strUserName = "<UserName>" ' e.g. rallen
strFullName = "<FullName>" ' e.g. Robbie Allen
strDescr = "<Description>" ' e.g. Employee account
strPassword = "<Password>" 
strComputer = "<ComputerName>"
' ------ END CONFIGURATION ---------
set objSystem = GetObject("WinNT://" & strComputer)
set objUser = objSystem.Create("user", strUserName)
objUser.FullName = strFullName
objUser.Description = strDescr
objUser.SetPassword strPassword
objUser.SetInfo
WScript.Echo objUser.Name & " created"

This code has been viewed 14681 times.

New from the creators of TechTasks.com: StatSheet.com