Jump to content
Sign in to follow this  
Guest radk

Command Interpreter

Recommended Posts

Guest radk

I am new to AutoIT, and I have been using it for a week or two.

The Question:

Is it possible in AutoIT to enter characters into Windows command interpreter, cmd.exe? Any suggestions or help is greatly appreciated.

Simple Example,

Start cmd.exe, and execute the command dir.

Thank You,

Rad

Share this post


Link to post
Share on other sites
scriptkitty

You can run directly if you like as well.

run(@comspec,"")
winwait(@comspec)
controlsend(@comspec,"","","dir{enter}")
sleep(1000)
controlsend(@comspec,"","","!{space}es{enter}")
winclose(@comspec)
msgbox(1,"Info",clipget())

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites
Guest radk

My goal was to use an AutoIT script to reset a password on an Unix system using ssh2.exe.

run(@comspec,"")

winwait(@comspec)

controlsend(@comspec,"","","ssh2 -l root 192.168.0.104 passwd admin{enter}")

sleep(2500)

controlsend(@comspec,"","","t3st1ng{enter}")

sleep(2500)

controlsend(@comspec,"","","letmein123{enter}")

sleep(2500)

controlsend(@comspec,"","","letmein123{enter}")

sleep(2500)

controlsend(@comspec,"","","!{space}es{enter}")

winclose(@comspec)

msgbox(1,"Info",clipget())

This is a great start. Thanks.

Rad

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.