Jump to content

The result is different for each run


Recommended Posts

AutoIt v3.3.14.5

$targetHost = "127.0.0.1"

$targetPort = "5000"

$dataBase = "big"

Run("notepad.exe")
Send("{UP}{UP}{SPACE}{TAB}{UP}{UP}{UP}{UP}")
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

$cmd = StringFormat("aaATALOG TCPIP NODE %s REMOTE %s SERVER %s OSTYPE WIN;CATALOG DATABASE %s AT NODE %s", $dataBase, $targetHost, $targetPort, $dataBase, $dataBase)
ControlSend($hWnd, "", "Edit1", $cmd)
sleep(1000)

Is this a bug?

Link to comment
Share on other sites

Well, not surprising since you are SendIng keystrokes to whatever happens to be in focus at that moment, which could be anything including the program you started right before.

Why not do your sending after the window is opened, and at least use controlsend?

 

Code hard, but don’t hard code...

Link to comment
Share on other sites

  • 2 weeks later...

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