我正在编写一个批处理文件来使用 Visual C++ 运行一些构建。我想“撤消”脚本末尾的 vsvars32.bat/vcvarsXX.bat 更改,以便我在脚本运行之前保持环境不变。
示例 1 - 使用 vsvars32.bat
call %VS100COMNTOOLS%vsvars32.bat
devenv myProject.sln /Build "Debug|Win32"
:: Now undo vsvars32.bat
示例 2 - 使用 vcvars32.bat 和 vcvars64.bat
<path to VC bin>vcvars32.bat
:: cmd line build calls for 32 bit application
:: Now undo vcvars32.bat
<path to VC bin>amd64\vcvars64.bat
:: cmd line build calls for 64 bit application
:: Now undo vcvars64.bat
有什么建议么?