quldude

PsExec not sending text after running AutoIT script exe.

4 posts in this topic

I have machine-A and machine-B. I am running the following command format on machine-A:

PsExec.exe -i -s \\machine-b -u username -p password "\\shared\driver\path\autoitscript.exe" "\\shared\driver\path\car.jpg"

The exe file takes in a file path and enters the path in a file upload window as soon as it detects the window poped up on machine-b. I can see the exe file being run but for some reason the file path is not being entered into the file upload window. Is there something wrong in the way i execute the psexec command or wrote the script? Locally everything works fine, i.e., on machine-a if I run "\\shared\driver\path\autoitscript.exe" "\\shared\driver\path\car.jpg", I see it being entered.

Script Sample:

Local $hWnd = WinWaitActive("Open", "", 20)

    If WinExists($hWnd) Then
        ControlSetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]", $CmdLine[1])
        ControlSend($hWnd, "", "[CLASS:Edit; INSTANCE:1]", "{ENTER}")
    EndIf

Share this post


Link to post
Share on other sites



Yes.

Share this post


Link to post
Share on other sites

Instead of using ControlSetText I used ControlSend or Send. That seems to work.

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