I am getting weird behavior of "Developer Command Prompt for VS 2017" command line tool. Normally in previous versions of visual studio this script (VsDevCmd.bat) was not messing current directory from where you run it. Now it seems to change it. One simple workflow would be just to start the shortcut "Developer Command Prompt for VS 2017" and it doesn't honor the "Start in" directory:
By any chance anyone seen this issue? It really bugs me because I used to have a shortcut with it and start CMD in my source directory, use TFS/msbuild commands afterwards.
You can set the VSCMD_START_DIR
environment variable to have vsdevcmd.bat
change to that directory when it finishes. Otherwise it will check if you have a %USERPROFILE%\source
directory and change to that (which is what you see).
You can change the "Target" for the "Developer Command Prompt for VS 2017" to something like the following to have change to a particular directory:
%comspec% /k "set VSCMD_START_DIR=C:\temp && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat""
Note that the path to vsdevcmd.bat
needs to be put in an additional set of double quotes.
Alternatively, rename or remove the %USERPROFILE%\source
directory (Note that this seems to be some kind of new "standard" directory for sources), that will make vsdevcmd.bat
honor the "Start In"-value (i.e. "current directory").
:: Some rocket scientist in Redmond made the VS15 VsDevCmd.bat change the cwd; the pushd/popd fixes that. pushd %CD% call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat" popd
"C:\Program Files (x86)\CruiseControl.NET\server\ccnet.exe" %*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With