Sign in to follow this  
Followers 0
dodik

script user account syntx err

2 posts in this topic

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 .

Share this post


Link to post
Share on other sites



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 .

Hi,

just delete the else and the endif in your function CreateUser.

;-))

Stefan

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0