title: Using a passed in parameter value to set PATH variables in a batch file
body: <p>Right now I have a batch file that sets the PATH variable to all of the required directories.(there is actually a bunch more required directories, i just took them out so the code snippet would not be too long) </p>
  
  <pre><code>@echo off
  
  set PATH=D:/src/trunk/build/bin;D:/src/trunk/build/bin/CoreTools;D:/src/trunk/build/bin/Plugins/Extensions;D:/src/trunk/build/bin/Plugins/CustomUI
  set DEBRIEF_INSTALL_DIR=D:/src/trunk/DebriefSuite/D3D_Installation
  set READERS=D:/src/trunk/build/bin/CoreTools/Readers
  set BINARY_DIR=D:/src/trunk/build
  
  cd D:/src/trunk/build/bin
  
  start PROGRAM.exe --ConfigFile="D:/src/trunk/DebriefSuite/Installation/config/Projects/config.xml" ^
                    --Mode-File="D:/src/trunk/DebriefSuite/Installation/config/Projects/Common/anotherconfig.xml" ^
                    --Env:Bin="D:/src/trunk/build/bin"
  
  
  cd D:/src/trunk
  </code></pre>
  
  <p>It works fine, but all of the directories are hard-coded. This needs to be able to work for other computers that might have their root directory in a different location. I need to be able to pass in a root directory (something like "D:\different_root_location") and substitute it in to each place in this code that currently says "D:\src\trunk". The problem is, i am not sure what the syntax would be for something like this. I am new to writing batch files. I tried doing something like</p>
  
  <pre><code>SET ROOTDIR=%1 .....
  </code></pre>
  
  <p>And then</p>
  
  <pre><code> set PATH=%ROOTDIR%/build/bin;%ROOTDIR%/build/bin/CoreTools;%ROOTDIR%/build/bin/Plugins/Extensions;%ROOTDIR%/build/bin/Plugins/CustomUI ..........
  
  start PROGRAM.exe --ConfigFile="%ROOTDIR%/DebriefSuite/Installation/config/Projects/config.xml" ^
  </code></pre>
  
  <p>but it did not work. I'm not really sure how to make this work! Also, any links to good sources of information about writing batch files in general would be extremely helpful since i am starting out!</p>