最近在工作中,需要使用“ VS2015 开发人员命令提示 ”进行编译Boost,打开该工具时,界面会提示“ Cannot determine the location of the VS Common Tools folder ”。

通过跟踪定位批处理文件,问题原因应该是找不到路径,因为这个路径写入注册表的,那为什么会读不到呢?博主找了很多资料,发现一个很简单的问题,因为读不到系统根目录路径,才无法找到注册表位置。
那很简单的一个办法,在环境变量中加入系统路径:
在Path后追加以下路径即可。
C:\Windows\System32\
但是问题来了,在博主的机器上解决了问题,在其他人的pc上又出现了同样的问题。而很搞笑的是,前面记录的这种方法并没有解决。因此暂时留给我问题在这里,后续找到解决方案再补充。

如果哪位大佬找到解决方案,还请不吝赐教,谢谢。
以下是参考的文章,可能对你有帮助。
VS2017 does not set registry entries for vcvars32.bat & vcvars64.bat
Cannot determine the location of the VS Common Tools folder
【问题解决】vs2013 command prompt错误:cannot determine the location of the vs common tools folder
vs2012 无法使用命令行提示符?ERROR: Cannot determine the location of the VS Common Tools folder.
VS2015编译Boost路径问题
本文探讨了在使用VS2015开发人员命令提示编译Boost时遇到的“Cannot determinethe location of the VSCommonTools folder”错误。通过分析,问题源于系统根目录路径未正确设置,导致注册表路径读取失败。文中尝试通过环境变量添加系统路径解决,但在不同PC上效果不一,寻求更通用的解决方案。
2万+





