Including the contents of the environment variables was a good idea. Based on the paths appearing there, it seems that you have the Windows Driver Kit installed and you're encountering this issue reported on Connect.
According to the description of the issue, the wdf
directory created by the WDK confuses the batch file that tries to determine the latest SDK versions available. For example, instead of
C:Program Files (x86)Windows Kits10includewdfucrt
in the INCLUDE
variable, you should have something like
C:Program Files (x86)Windows Kits10include10.0.10150.0ucrt
The "carpet-bombing" solution: uninstall the WDK, make sure the wdf
directories are gone, and things should return to normal.
If that's not an option, here's a "surgical" solution: you need to edit
"C:Program Files (x86)Microsoft Visual Studio 14.0Common7Toolsvcvarsqueryregistry.bat"
(back it up first, of course)
1. Look for the following two labels:
:GetWindowsSdkDirHelper32
:GetWindowsSdkDirHelper64
Under each of them, you'll find the following line:
@REM Get windows 10 sdk version number
@if not "%WindowsSdkDir%"=="" @FOR /F "delims=" %%i IN ('dir "%WindowsSdkDir%include" /b /ad-h /on') DO @set WindowsSDKVersion=%%i
Change it to:
@REM Get windows 10 sdk version number
@if not "%WindowsSdkDir%"=="" @FOR /F "delims=" %%i IN ('dir "%WindowsSdkDir%include" /b /ad-h /on') DO (
@if not "%%i"=="wdf" (
@set WindowsSDKVersion=%%i
)
)
2. Look for the following two labels:
:GetUniversalCRTSdkDirHelper32
:GetUniversalCRTSdkDirHelper64
Under each of them, change the following line:
@FOR /F "delims=" %%i IN ('dir "%UniversalCRTSdkDir%include" /b /ad-h /on') DO @SET UCRTVersion=%%i
to:
@FOR /F "delims=" %%i IN ('dir "%UniversalCRTSdkDir%include" /b /ad-h /on') DO (
@if not "%%i"=="wdf" (
@SET UCRTVersion=%%i
)
)
That's it. Let me know if it helped.
Keep in mind that this will skip the wdf
directories altogether. If the WDK command prompt setup scripts happen to use the same vcvarsqueryregistry.bat
batch file (I doubt it, but...), then they won't work correctly anymore; a bit more hacking will be needed in this case to select the proper batch file for each build environment.