title: Visual Studio Pre build events and batch set
body: <p>I'm trying to create call a batch file which sets a bunch of environment variables prior to building.</p>
  
  <p>The batch file looks something like this (it's automatically generated before-hand to detect ATI Stream SDK or NVidia CUDA toolkit):
  <pre><code>set OCL_LIBS_X86="%ATISTREAMSDKROOT%libs\x86"
  set OCL_LIBS_X64="%ATISTREAMSDKROOT%libs\x86_64"
  set OCL_INCLUDE="%ATISTREAMSDKROOT%include"</pre></code></p>
  
  <p>However, the rest of the build doesn't seem to have access to these variables, so when I try to reference $(OCL_INCLUDE) in the C/C++>General>Additional include directories, it will first give me warning that environment variable $(OCL_INCLUDE) was not found, and when I try to include CL/cl.hpp the compile will fail with:</p>
  
  <blockquote>
    <p>fatal error C1083: Cannot open include file: 'CL/cl.hpp': No such file or directory</p>
  </blockquote>
  
  <p>I know that I could put these variables into the registry if I wanted to access them from the visual studio GUI, but I would really prefer not to do this. Is there a way to to get these environment variables to stick after the pre-build events? I can't reference $(ATISTREAMSDKROOT) directly because the project must be able to build for both ATI Stream and NVidia Cuda.</p>