vs2012 无法使用命令行提示符?ERROR: Cannot determine the location of the VS Common Tools folder.
2014-05-05 15:19
1586 查看
vs2012 无法使用命令行提示符?
提示:
百度了很多方法,都是直接修改vcvars32.bat 文件指定具体路径:
根本原因:公司禁用了注册表编辑器
查看vcvars32.bat 代码,可以看到,它使用reg命令从注册表取路径。由于禁用了注册表编辑器,reg无法运行。所以取不到路径。
:GetVSCommonToolsDir
@set VS110COMNTOOLS=
@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1
@exit /B 0
:GetVSCommonToolsDirHelper32
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "11.0"') DO (
@if "%%i"=="11.0" (
@SET "VS110COMNTOOLS=%%k"
)
)
@if "%VS110COMNTOOLS%"=="" exit /B 1
@SET "VS110COMNTOOLS=%VS110COMNTOOLS%Common7\Tools\"
@exit /B 0
解决办法:
取消禁用注册表编辑器!
提示:
ERROR: Cannot determine the location of the VS Common Tools folder. |
打开VS2012命令提示符时报错“ERROR: Cannot determine the location of the VS Common |
查看vcvars32.bat 代码,可以看到,它使用reg命令从注册表取路径。由于禁用了注册表编辑器,reg无法运行。所以取不到路径。
:GetVSCommonToolsDir
@set VS110COMNTOOLS=
@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1
@exit /B 0
:GetVSCommonToolsDirHelper32
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "11.0"') DO (
@if "%%i"=="11.0" (
@SET "VS110COMNTOOLS=%%k"
)
)
@if "%VS110COMNTOOLS%"=="" exit /B 1
@SET "VS110COMNTOOLS=%VS110COMNTOOLS%Common7\Tools\"
@exit /B 0
解决办法:
取消禁用注册表编辑器!
相关文章推荐
- VS2010 Command Prompt Error:Cannot determine the location of the VS Common Tools folder
- ERROR: Cannot determine the location of the VS Common Tools folder.
- ERROR Cannot determine the location of the VS Common Tools Folder
- ERROR Cannot determine the location of the VS Common Tools Folder
- Error: Cannot Determine the location of the VS common tools folder
- VS Command Prompt ERROR: Cannot determine the location of the VS Common Tools folder解决办法总结
- Cannot determine the location of the VS Common Tools folder.
- 【问题解决】vs2013 command prompt错误:cannot determine the location of the vs common tools folder
- cannot determine the location of the vs common tools folder
- Android studio升级3.0,提示“Error:Cannot choose between the following configurations of project”错误
- Latex Error cannot determine the size of graphic 报错的解决的方法
- 编码解码器无法使用提供的流类型 The codec cannot use the type of stream provided
- Android studio升级3.0,提示“Error:Cannot choose between the following configurations of project”错误
- 打开eclipse的opens the android sdk and avd manager提示错误:error:location of the android sdk has not been .
- SQL Server Data Tools – Business Intelligence for VS 2012安装时提示“The CPU architecture....”的解决方法
- 打开eclipse的opens the android sdk and avd manager提示错误:error:location of the android sdk has not been
- VMware安装Ubuntu17.04的VMware-tools提示:what is the location of the "ifconfig" program on your machin问题解决
- wpf 解决 编码解码器无法使用提供的流类型 The codec cannot use the type of stream provided
- Latex Error cannot determine the size of graphic 报错的解决办法
- VS报错:The build tools for v140 (Platform Toolset = 'v140') cannot be found