dodik Posted July 27, 2009 Share Posted July 27, 2009 i was edit script for create user account win.xp. but get syntax eror. -------------- Global $Newuser = "chall" ;This is the User account to be created Global $Newpass = "pass" ;This is were you enter the password you want for this account Global $Comment = "Administration Account" ;This is a discription of the account that is added to the windows. Optional - leave blank for nothing to be entered Global $FName = "System Admin" ;This is the Full name section of the account. Optional - leave blank for nothing to be entered Func CreateUser(); RunWait('net user '& $Newuser & ' ' & $Newpass & ' /add /fullname:"' & $FName & '" /comment:"' & $comment & '"', '', @SW_HIDE) RunWait('net user '& $Newuser & ' /EXPIRES:never', '', @SW_HIDE) RunWait('net localgroup users ' & $Newuser & ' /delete', '', @SW_HIDE) RunWait('net localgroup Administrators ' & $Newuser & ' /add', '', @SW_HIDE) RunWait('net accounts /maxpwage:unlimited', '', @SW_HIDE) else endif EndFunc(); ------------- D:\script\test user.vb.au3(17,1) : ERROR: syntax error else ^ D:\script\test user.vb.au3 - 1 error(s), 0 warning(s) >Exit code: 2 Time: 0.361 --------- any one help me pls. thanks . Link to comment Share on other sites More sharing options...
99ojo Posted July 27, 2009 Share Posted July 27, 2009 i was edit script for create user account win.xp. but get syntax eror.--------------Global $Newuser = "chall" ;This is the User account to be createdGlobal $Newpass = "pass" ;This is were you enter the password you want for this accountGlobal $Comment = "Administration Account" ;This is a discription of the account that is added to the windows. Optional - leave blank for nothing to be enteredGlobal $FName = "System Admin" ;This is the Full name section of the account. Optional - leave blank for nothing to be enteredFunc CreateUser();RunWait('net user '& $Newuser & ' ' & $Newpass & ' /add /fullname:"' & $FName & '" /comment:"' & $comment & '"', '', @SW_HIDE)RunWait('net user '& $Newuser & ' /EXPIRES:never', '', @SW_HIDE)RunWait('net localgroup users ' & $Newuser & ' /delete', '', @SW_HIDE)RunWait('net localgroup Administrators ' & $Newuser & ' /add', '', @SW_HIDE)RunWait('net accounts /maxpwage:unlimited', '', @SW_HIDE)else endifEndFunc();-------------D:\script\test user.vb.au3(17,1) : ERROR: syntax errorelse^D:\script\test user.vb.au3 - 1 error(s), 0 warning(s)>Exit code: 2 Time: 0.361---------any one help me pls.thanks .Hi,just delete the else and the endif in your function CreateUser.;-))Stefan Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now