Ok I found the problem.
Calling VCVARSALL.BAT (which the auto generated bat file does before calling nmake to launch development prompt) changes the current working directory as of VS2017.
To Fix the bat script needs
https://developercommunity.visualstudio.com/content/problem/26780/vsdevcmdbat-changes-the-current-working-directory.html
to predefine the working directory. This should be in the model.bat file that gets generated when building but it isn't.