title: Batch File: Error in relative path , one level up from the current directory
body: <p>I am new to the batch script programming.Getting error while executing batch file if I give the relative path.
  I have following folder structure</p>
  
  <pre><code>Script folder - C:\batch\script\ServiceRegister.bat
  Bin path - C:\batch\bin\ERecruitGenerateReportsWindowsService.exe
  </code></pre>
  
  <p>ServiceRegister.bat Batch file – </p>
  
  <pre><code>%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe %~dp0%~1\bin\ERecruitGenerateReportsWindowsService.exe
  </code></pre>
  
  <p>When I execute ServiceRegister.bat file I got the error:</p>
  
  <pre><code>Exception occurred while initializing the installation:
  System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\batch\script\bin\ERecruitGenerateReportsWindowsService.exe' or one of its dependencies. The system cannot find the file specified.
  </code></pre>
  
  <p>I am using “%~dp0%~1” to go one level up in the directory still it gets its current path.</p>
  
  <pre><code>%~dp0%~1 - C:\batch\script\  
  </code></pre>
  
  <p>I need the C:\batch\  path. How I can get this path?
  It works fine If I give the absolute path -</p>
  
  <pre><code>%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\batch\bin\ERecruitGenerateReportsWindowsService.exe
  </code></pre>