Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am attempting to create a pre-defined user account with a password set by the user. I keep getting the following error:
Line: 22
Char: 39
Error: Expected 'Loop"
Code: 800A03FBHere is my code:
' ------ SCRIPT CONFIGURATION ------
strUserName1 = "remote-emar"
strFullName1 = "Remote eMAR"
strDescr1 = "Remote Support Account"
strGroup = "Administrators"
strComputer = CreateObject("WScript.Network").ComputerName
title = "User Account Creation"
' ------ END CONFIGURATION ---------
do
strPassword1 = InputBox("Enter remote-emar account password. *case sensitive*", title)set objSystem = GetObject("WinNT://" & strComputer)
set objUser = objSystem.Create("user", strUserName1)
objUser.FullName = strFullName1
objUser.Description = strDescr1
objUser.SetPassword strPassword1
objUser.SetInfoSet objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup)
Set objUser = GetObject("WinNT://" & strComputer & "/" & strUserName1)
objGroup.Add(objUser.ADsPath)
WScript.Echo objUser.Name & " created"
WScript.quit
'-------------END SCRIPT------------Any thoughts?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |