This was a design change that was made for the developer command prompt scripts for Visual Studio 2017. However, there is an "escape hatch" available to ensure the command prompt ends up in a known directory.
They also provide a workaround:
@REM set the directory to the current directory (or directory of your choice)
set "VSCMD_START_DIR=%CD%"
"call <vsinstance_path>\Common7\Tools\VsDevCmd.bat"
Temporary workaround:
Set command arguments to /k "set "VSCMD_START_DIR=%CD%" && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\..\Tools\VsDevCmd.bat""
Hello,
When using the "Dev Cmd Prompt" preset the working directory is not correctly set.
Current behaviour: opens in
C:\Users\<username>\Source
Expected behaviour: opens inC:\<SomeFolder>\<SomeSolutionDirectory>\<SomeProjectDirectory
VsDevCmd.bat changes the current working directory causing path resolution to fail in existing scripts mentions the following:
They also provide a workaround:
Temporary workaround: Set command arguments to
/k "set "VSCMD_START_DIR=%CD%" && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\..\Tools\VsDevCmd.bat""