title: Visual Studio adding truly "global" default include path
body: <p>Is there a simple way to add a path, <strong>globally</strong> (i.e. for all users on a machine), to the set of include/library directories in Visual Studio?</p>
  
  <p>What I am looking for is the ability to <em>safely</em> add an include/library path to Visual Studio for all projects (past and future).  This would be the equivalent of the INCLUDE, LIB, and LIBPATH environment variables that seem to work for command-line builds, but for some reason are completely ignored when building through Visual Studio.  It must be applied to all users on a machine.</p>
  
  <p>What I am <strong>NOT</strong> looking for is changing the user-specific MSBuild property sheets, <code>Microsoft.Cpp.Win32.user.props</code>, as this only adds the paths for a particular user on a particular machine.  Though this seems to be the recommended way to accomplishing "global" settings, it cannot be applied in my use-case:</p>
  
  <p>I am involved in teaching an introduction to programming for engineers class, with roughly 1000 students per year.  We have a computer lab for them to work on weekly lab quizzes, but any per-user settings/documents are purposely cleared every time a student logs out (hence we cannot rely on the user-props).  As part of the course, they need to work with a custom course library for interacting with a hardware unit (hence the need to add an include/lib path).  Manually adding the paths for each project is beyond what we teach students, and would become tedious given that they will create several projects per week through the term.</p>
  
  <p>What we have tried:</p>
  
  <ul>
  <li>installing the required headers/libraries to the Windows SDK paths.<br/> 
  This is definitely not ideal, and breaks whenever the Windows SDK is updated to a newer version</li>
  <li>installing the required header/libraries to Visual Studio's <code>Auxiliary</code> path.<br/>
  By examining the default VC++ Include Directories, it seems like VS2017 includes the path <code>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS</code> in its searches for headers and libraries.  According to the <a href="https://blogs.msdn.microsoft.com/vcblog/2016/10/07/compiler-tools-layout-in-visual-studio-15/" rel="noreferrer">docs</a>, the folder is supposed to be for tools that are not truly part of the compilation process.  This is what we currently do, but it feels wrong, and the folder location has changed with past Visual Studio versions, so may change in the future (we were stuck with VS2012 for the last 5 years because of this).  We would also have to re-install the library whenever we update Visual Studio in the lab.</li>
  </ul>
  
  <p>What we <em>could</em> try:</p>
  
  <ul>
  <li>Adding the paths to the toolset default property sheets.<br/>
  Again, this is recommended against in various forums in favour of using the user-props ones (e.g. <a href="https://stackoverflow.com/questions/335408/where-does-visual-studio-look-for-c-header-files/9410989#9410989">here</a>).  The sheets themselves warn not to modify them, there's a fear they can be reset whenever the toolset is updated, and if a new toolset is installed while upgrading VS, we would have to re-modify the default sheets for that toolset.</li>
  <li>Creating a project template with the desired settings.<br/>
  We <em>could</em> create a template that students should choose when they create their new project through the New Project Wizard.  The fear is that if students create a project with the wrong template (which will inevitably occur often with classes of such sizes), and begin their quiz tasks without the proper environment set, it will be a nightmare dealing with the issues that come up with our limited staff.  Also, templates are VS version-specific (and placed in a version-specific folder), so we would have to re-install the template every time the visual studio version is changed.</li>
  </ul>
  
  <p>The whole idea is to future-proof our workflow.  What we want to do is incredibly simple: add a single header and a single library to the default search paths, and it should work with any version of Visual Studio installed on a machine.  On any other system/IDE, this is a trivial task.  Command-line MSBuild even supports it through Environment Variables.  But for some reason, we cannot find a simple solution with Visual Studio.  </p>
  
  <p>Does anyone have a better idea?</p>