I am trying to automate installation of an exe file on remote systems. My AutoIt script automates the installation. If I run this script from the system where I need to install, everything works fine.
Problem occurs when I initiate the script from a remote machine. The exe starts but it does not function (wait for the window to appear, then send Enter, etc.). My AutoIt script:
Run("setup.exe")
WinWaitActive("Installation Wizard")
Send("{ENTER}")
WinWaitActive("Installation Wizard")
Sleep(1000)
Send("{TAB}")
Sleep(1000)
Send("data")
Sleep(1000)
Send("{TAB}")
Sleep(1000)
Send("{ENTER}")
I am using the exe generated from the au3 file from a batch file to be run on the remote machine. Batch file:
PsExec.exe \\host -u <user> -p <pass> -i <session id> "<path to batch>\autoitinstall.bat"
Giving the session id as above resolves the issue of window not opening. But once I minimize the RDP window the window becomes inactive. How can I make sure that the setup.exe window is active all the time in the remote system (even if I minimize the RDP window)?
Batch file on remote system:
cd /d <path to the exe generated from au3 file>
start autoitinstall.exe