title: How open GUI program with Autoit from Jenkins
body: <p>I need to automate a Windows GUI program which runs in Windows. To do this I set up a Windows 2012 R2 machine on AWS, I installed Autoit on it and I wrote the script that launches the GUI program and does stuff on it (let's call this script <strong><em>auto.au3</em></strong>). </p>
  
  <p>I run this script from Windows command line passing a parameter to it, and it works perfectly. The problem is that I need to launch it from Jenkins, and when I call the auto.au3 through the job the script seems not to be able to open the GUI program. </p>
  
  <p>I configured Jenkins as slave on Windows (so I call it from my "main" Jenkins), enabled the "allow service to interact with the desktop", I added Autoit installation directory as a PATH environment variable to Jenkins and I wrote the batch command (which works directly on Windows) in Jenkins. Looks like this (%domain% is a jenkins build parameter):</p>
  
  <pre><code>SET PATH=%PATH%;%AUTOIT_PATH%
  
  AutoIt3 C:\Users\Administrator\Desktop\auto.au3 param1 "%domain%"
  </code></pre>
  
  <p>The first step on auto.au3 is:</p>
  
  <pre><code>Run("C:\Program Files (x86)\GUIprogram.exe")
  </code></pre>
  
  <p>which works fine when executed from Windows but when launched from Jenkins does not open the program and the job gets stuck.</p>
  
  <p>I also tried creating a python script that runs auto.au3 script to check if the error was in the PATH environment variable, but I checked that python works fine until it runs auto.au3, and then it also gets stuck at the first step. Again, only happens when I call it from Jenkins. If I execute it logged in on the machine and running the batch command directly, it works.</p>
  
  <p>Is there some restriction that avoids launching GUI programs through Jenkins? Did I missed some configuration to allow it?</p>
  
  <p>Thank you very much!</p>
  
  <p>--EDIT------</p>
  
  <p>I started the application and and removed the "launch app" code line, and still it's not doing nothing. Seems that auto.au3 is not doing nothing at all.</p>