views:

606

answers:

1

How to create a user account in Windows Vista using VBScript?

I'm using the following script. It's working fine on Windows XP, but gives me an error on Windows Vista:

strUserName = "username"
strPassword = "password"
strComputer = "."
set objSystem = GetObject("WinNT://" & strComputer)
set objUser = objSystem.Create("user", strUserName)
objUser.SetPassword strPassword
objUser.SetInfo
+2  A: 

I am able to run this script on my Vista box just fine, and it creates the user.

I suspect this is a UAC issue?

Vista’s UAC: How to elevate scripts (VBScript and JScript)

Jeff Atwood
Thanks Jeff, wow, I have been listing to your podcast for long time, but never actually thought you will answer one of my questions :-)John Morad,