Jump to content

Recommended Posts

Guest radk
Posted

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

Posted

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.

Guest radk
Posted

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

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