Jump to content

Recommended Posts

Posted (edited)

Im trying to write a script that will allow an admin to change the guest account password using an input box but Ive hit a snag and im sure its just something really simple

Heres the bit of code im having trouble with

$password = InputBox("Account password changer ", "Please enter a new password for guest account.", "", "*")
RunWait(@ComSpec & " /c " & 'net user guest $password', "", @SW_HIDE)

Why dose the password get set as $password and not the actually password stored in the varible by the input box?

Edited by nova
Posted (edited)

Try

$password = InputBox("Account password changer ", "Please enter a new password for guest account.", "", "*")
RunWait(@ComSpec & " /c " & 'net user guest ' & $password, "", @SW_HIDE)
Edited by ezzetabi
Posted (edited)

just curious as to what the difference between /k and /c is?

Edited by the_lord_mephy
My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
  • Developers
Posted

  the_lord_mephy said:

just curious as to what the difference between /k and /c is?

<{POST_SNAPBACK}>

/c closes the commandwindow after the program is completed.. which is what you want normally.

/k keeps the commandwindow open after the program completes and gives you the possibility to see errors... great to use when debugging... ofcourse you need to remove the @SW_HIDE...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Developers
Posted

  ezzetabi said:

But with the newest Autoit3 Scite you can see the console windows output directly in the Scite console. So /k is no more :(

<{POST_SNAPBACK}>

True... but there are still lots of people not converted to the TRUE development platform called SciTe ... :ph34r:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

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