From 5ed2b79bcc39e9bae4ae9bb4fe298957862682f5 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sun, 16 Jul 2017 16:12:47 +0300 Subject: [PATCH] build: prevent VsDevCmd.bat from changing cwd VsDevCmd.bat changes the current working directory to "%USERPROFILE%\Source" if it exists. Setting VSCMD_START_DIR overrides this behavior. PR-URL: https://github.com/nodejs/node/pull/14303 Fixes: https://github.com/nodejs/node/issues/14300 Refs: https://developercommunity.visualstudio.com/content/problem/26780/vsdevcmdbat-changes-the-current-working-directory.html Reviewed-By: Gibson Fahnestock Reviewed-By: Refael Ackermann Reviewed-By: Richard Lau Reviewed-By: James M Snell --- vcbuild.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcbuild.bat b/vcbuild.bat index 03cf82565d4a7a..3d35798a082fea 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -176,6 +176,8 @@ if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_ set "VSINSTALLDIR=" call tools\msvs\vswhere_usability_wrapper.cmd if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015 +@rem prevent VsDevCmd.bat from changing the current working directory +set "VSCMD_START_DIR=%CD%" set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg% echo calling: %vcvars_call% call %vcvars_call%