@Echo off
title 双心一键获取winsxs的写入权限,解决VC运行库安装error1935等错误
set path=%path%;%~dp0
setlocal EnableDelayedExpansion
set /P dv=请输入要处理的windows的根路径(例如C:,直接回车默认为C:盘):
if not defined dv set dv=C:
::获取管理员权限
TAKEOWN /F "%dv%\Windows\winsxs" /r /d Y
ICACLS "%dv%\Windows\winsxs" /Grant %USERNAME%:F /T /Q /inheritance:e
REM ICACLS "%dv%\Windows\winsxs" /Grant Administrators:F /T /Q /inheritance:e
ICACLS "%dv%\Windows\winsxs" /Grant EVERYONE:F /T /Q /inheritance:e
md %dv%\Windows\winsxs\InstallTemp
md %dv%\Windows\winsxs\Temp
echo 已获取winsxs的写入权限!
pause
臭名昭著的error1935错误,随便从网上来个截图: