title: How can I find the latest Visual Studio Developer Command Prompt in a batch file?
body: <p>I need to write a batch file to complete a pre-build step in Visual Studio. As part of it, I need to call the Visual Studio Developer Command Prompt.</p>
  
  <p>I know that for VS2015, the developer command prompt is located in <code>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat</code>.</p>
  
  <p>Unfortunately, our build server has a different version of VS. Is there a simple way to find the latest <code>VSDevCmd.bat</code> for all (or most) versions of Visual Studio in a batch file, so the pre-build step will work on both environments?</p>