title: Jenkins - Sharing worskpace with parent job considering slaves, remote workspace
body: <p>I'm struggling with a Jenkins problem. It was even hard to describe it in the title, so sorry if you were confused.</p>
  
  <p>My whole project structure is as follows:</p>
  
  <p>main job:</p>
  
  <ul>
  <li><p>Checkout job into main job's directory</p></li>
  <li><p>Parametrized building job #1 ( using remote worspace [in this case it's the parent's folder])</p></li>
  <li><p>Parametrized building job #2 (same)</p></li>
  <li><p>Parametrized building job #X (same)</p></li>
  </ul>
  
  <p>The problem is each building job executes a .bat file that is in a specific folder of the checked out SVN directory. In order to reuse code I am sticking to the job performed by bat files. Each of them takes parameters. One of the params is always a local directory on the slave.</p>
  
  <p>I cannot accomplish my task because :<br>
  1) If I tried to use the %workspace% it doesn't work for custom workspace (it provides just the <strong>RELATIVE</strong>  path from the jenkins's folder. I can't afford to hardcode the path. Jenkins will be run on differents OSs.  </p>
  
  <p>2)  Using %JENKINS_HOME% + local redirecting fails as it provides the location of the jenkins on master (it's even a different OS)  </p>
  
  <p>3) Using %~dp0 for the bat (it's often use to receive the location where the files is executed) returns C:\Windows\Temp . I don't even have the strengh to inquire why.</p>
  
  <p>I have ran out of ideas. I have been struggling for about 1.5 weeks now.</p>
  
  <p>There are a couple of ways to restructurize the whole project but it will be time consuming and my present work will occur fruitless.</p>