title: Jenkins can't find file on the slave/agent?
body: <p>I have changed our Jenkins setup from everything running on one machine to a master-agent/slave setup. Before that everything worked fine, now I am facing issues that some programs I am calling that access files can't find them.</p>
  
  <p><strong>Case 1:</strong><br>
  (Pls don't ask why it is so complicated, but the file structure is given and I can't change it)<br>
  I am calling a python script, that iself calls a batch file</p>
  
  <pre><code>filepath= os.path.abspath(os.path.join(pamFolder, "run.bat"))
  p = subprocess.Popen(filepath, cwd=pamFolder, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  </code></pre>
  
  <p>... and the batch file again a jar file with the actual program</p>
  
  <pre><code>java -XX:-UseGCOverheadLimit -cp "../..;../../libs/*" -jar ..\..\myjarfile.jar
  </code></pre>
  
  <p>Within the jar file there is an access to a file on the disk failing with an error message that the file can't be found: </p>
  
  <pre><code>ERR : The file was not found in the specified path 'U:\somefile.txt'. Please check this path for access and your configuration!
  </code></pre>
  
  <p><strong>Case 2:</strong><br>
  I am calling a batch file from Jenkins that is calling some other exe and in the end trying to open a file in Excel via the COM interface. Here I am getting the following exception (Excel can't access the file):</p>
  
  <pre><code>Unhandled Exception: System.Runtime.InteropServices.COMException: Microsoft Excel kann auf die Datei 'D:\Jenkins\workspace\myJob\someDir\someFile.xlsm' nicht zugreifen.
  </code></pre>
  
  <p><strong>Question</strong><br>
  As previously mentioned, both jobs were working in the previous setup. Both files DO exist.<br>
  I suspect that Jenkins / the programs are trying to find the files on the master where they are not available.</p>
  
  <p>Is there any way to tell Jenkins that the called tools are fully executed on the slave node or in some other way tell them where to find these files?</p>
  
  <p><strong>EDIT</strong><br>
  The job is already running on the slave. The console shows Running on [slave name] in D:/Jenkins/workspace/xxxxx.<br>
  The master is configured in a way that only jobs assigned to it run on the master. So pretty much all jobs should run on the slave.</p>
  
  <p><strong>EDIT2 / SOLUTION</strong><br>
  It turned out that the 2 issues are caused by different things.<br>
  Case1: Solved this by using the UNC path<br>
  Case2: Solved by a mixture of giving the necessary permissions as described <a href="https://waheedrous.wordpress.com/2014/01/26/error-office-interop-assemblies/" rel="nofollow noreferrer">here</a> and starting the slave service with a user with admin rights.</p>