news 2026/6/18 1:14:10

重装 Visual C++ 的完整流程-PowerShell 版

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
重装 Visual C++ 的完整流程-PowerShell 版
#Requires -RunAsAdministrator <# .SYNOPSIS 重装 Visual C++ 运行库(2005 ~ 2026) .DESCRIPTION 1. 使用 VisualCppRedist AIO 卸载全部已检测到的运行库 2. 使用 VisualCppRedist AIO 静默安装全部运行库 3. 使用微软官方 VC_redist 安装包补充安装 2015-2022 (x64/x86) .NOTES 请将本脚本与以下安装包放在同一目录后运行: - VisualCppRedist_AIO_x86_x64.exe - VC_redist.x64.exe - VC_redist.x86.exe 右键「以管理员身份运行 PowerShell」,然后执行: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass .\Reinstall-VisualCpp.ps1 #> $ErrorActionPreference = 'Stop' $ScriptDir = $PSScriptRoot $AioInstaller = Join-Path $ScriptDir 'VisualCppRedist_AIO_x86_x64.exe' $VcRedistX64 = Join-Path $ScriptDir 'VC_redist.x64.exe' $VcRedistX86 = Join-Path $ScriptDir 'VC_redist.x86.exe' function Write-Step { param([string]$Message) Write-Host "" Write-Host "==> $Message" -ForegroundColor Cyan } function Invoke-Installer { param( [string]$Path, [string[]]$Arguments, [string]$Label ) if (-not (Test-Path -LiteralPath $Path)) { throw "找不到安装包:$Path" } Write-Host " 运行: $(Split-Path -Leaf $Path) $($Arguments -join ' ')" $process = Start-Process -FilePath $Path -ArgumentList $Arguments -Wait -PassThru if ($process.ExitCode -ne 0) { throw "$Label 失败,退出码: $($process.ExitCode)" } Write-Host " $Label 完成 (退出码 0)" -ForegroundColor Green } Write-Host "========================================" -ForegroundColor Yellow Write-Host " Visual C++ 运行库 一键重装脚本" -ForegroundColor Yellow Write-Host " 安装包目录: $ScriptDir" -ForegroundColor Yellow Write-Host "========================================" -ForegroundColor Yellow Write-Step "第 1/3 步:卸载全部 Visual C++ 运行库" Invoke-Installer -Path $AioInstaller -Arguments @('/aiR', '/gm2') -Label "AIO 卸载" Write-Step "第 2/3 步:安装全部 Visual C++ 运行库 (AIO)" Invoke-Installer -Path $AioInstaller -Arguments @('/ai', '/gm2') -Label "AIO 安装" Write-Step "第 3/3 步:安装微软官方 2015-2022 运行库" Invoke-Installer -Path $VcRedistX64 -Arguments @('/install', '/quiet', '/norestart') -Label "VC_redist x64" Invoke-Installer -Path $VcRedistX86 -Arguments @('/install', '/quiet', '/norestart') -Label "VC_redist x86" Write-Host "" Write-Host "========================================" -ForegroundColor Green Write-Host " 全部完成!建议重启电脑使变更生效。" -ForegroundColor Green Write-Host "========================================" -ForegroundColor Green

保存成.Reinstall-VisualCpp.ps1文件,以管理员身份打开 PowerShell,执行:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass C:\Users\admin\Downloads\Reinstall-VisualCpp.ps1

注意,三个安装包要放在同一文件夹下:

  • VisualCppRedist_AIO_x86_x64.exe(下载链接:Releases · abbodi1406/vcredist · GitHub
  • VC_redist.x64.exe(下载链接:https://aka.ms/vs/17/release/vc_redist.x64.exe
  • VC_redist.x86.exe(下载链接:https://aka.ms/vs/17/release/vc_redist.x86.exe

运行完成后建议重启电脑。

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/18 1:11:02

Navicat密码解密终极指南:如何快速找回遗忘的数据库密码

Navicat密码解密终极指南&#xff1a;如何快速找回遗忘的数据库密码 【免费下载链接】navicat_password_decrypt 忘记navicat密码时,此工具可以帮您查看密码 项目地址: https://gitcode.com/gh_mirrors/na/navicat_password_decrypt 你是否曾经面临这样的尴尬时刻&#…

作者头像 李华
网站建设 2026/6/18 1:00:42

传奇 3 光通版手游官网下载:传奇 3 光通版全网唯一最新官方下载渠道

传奇 3 光通版手游官网下载&#xff1a;传奇 3 光通版全网唯一最新官方下载渠道 《传奇 3 光通版》也就是经典 1.45 复古传奇 3 点卡服&#xff0c;由安徽游昕网络联合忆往游戏正版运营复古 MMORPG 手游。1:1 完整复刻原版端游全部场景&#xff0c;银杏山谷、比奇城、蜈蚣洞、…

作者头像 李华
网站建设 2026/6/18 0:53:58

IEEE 802.15.4 MAC层数据结构与状态枚举深度解析

1. 项目概述&#xff1a;深入IEEE 802.15.4 MAC层的“骨架”与“血液”如果你正在开发基于ZigBee、Thread或6LoWPAN的物联网设备&#xff0c;那么你每天都在和IEEE 802.15.4标准打交道&#xff0c;只是你可能没有直接面对它最底层、最核心的部分——MAC层的数据结构与状态枚举。…

作者头像 李华
网站建设 2026/6/18 0:52:55

PostgreSQL数据库设计终极指南:5分钟掌握PGModeler高效建模

PostgreSQL数据库设计终极指南&#xff1a;5分钟掌握PGModeler高效建模 【免费下载链接】pgmodeler Open-source data modeling tool designed for PostgreSQL. No more typing DDL commands. Let pgModeler do the work for you! 项目地址: https://gitcode.com/gh_mirrors/…

作者头像 李华
网站建设 2026/6/18 0:49:56

Adobe Illustrator脚本集合:设计师必备的70+效率倍增器

Adobe Illustrator脚本集合&#xff1a;设计师必备的70效率倍增器 【免费下载链接】illustrator-scripts Some powerfull JSX scripts for extending Adobe Illustrator 项目地址: https://gitcode.com/gh_mirrors/ill/illustrator-scripts 你是否经常在Adobe Illustrat…

作者头像 李华
网站建设 2026/6/18 0:49:48

PostgreSQL数据库建模终极指南:pgModeler完整解决方案深度解析

PostgreSQL数据库建模终极指南&#xff1a;pgModeler完整解决方案深度解析 【免费下载链接】pgmodeler Open-source data modeling tool designed for PostgreSQL. No more typing DDL commands. Let pgModeler do the work for you! 项目地址: https://gitcode.com/gh_mirro…

作者头像 李华