安装VS2013和卸载VS2015的时候都遇到这个问题了,记录下来
OS: windows 7
develop tool: visual studio 2013 with update 5
error: Error 1402. Could not open key:
参考这里的方法解决的:
操作步骤:
1, 下载 SubInACL tool 安装到默认目录(下载地址)
默认安装完成后,在“C:\Program Files (x86)\Windows Resource Kits\Tools“目录下可以找到“subinacl.exe”
2,在“C:\Program Files (x86)\Windows Resource Kits\Tools“目录下新建一个记事本文件,把下边内容拷贝进去,文件命名"reset.cmd"
echo. echo Resetting ACLs… echo (this may take several minutes to complete) echo. echo IMPORTANT NOTE: For this script to run correctly, you must change echo the values named YOURUSERNAME to be the Windows user account that echo you are logged in with. echo. echo ========================================================================== echo. echo. subinacl.exe /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /setowner=administrators > %temp%\subinacl_output.txt echo. echo. subinacl.exe /keyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /setowner=administrators >> %temp%\subinacl_output.txt echo. echo. subinacl.exe /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt echo. echo. subinacl.exe /keyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt echo. echo. subinacl.exe /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt echo. echo. subinacl.exe /keyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt echo. echo. echo System Drive… subinacl.exe /subdirectories %ProgramFilesPath%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt echo. echo. echo Windows Directory… subinacl.exe /subdirectories %windir%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt echo. echo. echo ========================================================================== echo. echo FINISHED. echo. echo Press any key to exit . . . pause >NUL popd :END3,以管理员方式打开命令行并切换到“ C:\Program Files (x86)\Windows Resource Kits\Tools”目录下,执行reset.cmd文件
遇到错误处理的办法可以参考原文
References:
1,Solving setup errors by using the SubInACL tool to repair file and registry permissions