Jump to content
Sign in to follow this  
Nova

Printing varible in cmd window

Recommended Posts

Nova

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

Share this post


Link to post
Share on other sites
ezzetabi

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

Share this post


Link to post
Share on other sites
the_lord_mephy

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]

Share this post


Link to post
Share on other sites
Jos

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...


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ezzetabi

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

Share this post


Link to post
Share on other sites
the_lord_mephy

Scite owns lol


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]

Share this post


Link to post
Share on other sites
Jos

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:

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×