Jump to content

script user account syntx err


Recommended Posts

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

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...