@echo off
cls
echo Visual C++ Redistributable Installer
echo ===================================
echo Fixes MSVCP140_2.dll missing error
echo ===================================
:: Check system architecture
set ARCH=x86
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set ARCH=x64
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" set ARCH=x64
echo System: %ARCH%
echo.
:: Set download paths
set TEMP_DIR=%TEMP%
:: Download and install for 64-bit
if "%ARCH%"=="x64" (
echo Step 1: Downloading Visual C++ x64...
powershell -Command "Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vc_redist.x64.exe' -OutFile '%TEMP_DIR%\vc_x64.exe'"
echo Step 2: Installing Visual C++ x64...
if exist "%TEMP_DIR%\vc_x64.exe" (
"%TEMP_DIR%\vc_x64.exe" /quiet /norestart
echo x64 installed successfully
) else (
echo x64 download failed
)
echo.
echo Step 3: Downloading Visual C++ x86 (compatibility)...
powershell -Command "Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vc_redist.x86.exe' -OutFile '%TEMP_DIR%\vc_x86.exe'"
echo Step 4: Installing Visual C++ x86...
if exist "%TEMP_DIR%\vc_x86.exe" (
"%TEMP_DIR%\vc_x86.exe" /quiet /norestart
echo x86 installed successfully
) else (
echo x86 download failed
)
) else (
echo Step 1: Downloading Visual C++ x86...
powershell -Command "Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vc_redist.x86.exe' -OutFile '%TEMP_DIR%\vc_x86.exe'"
echo Step 2: Installing Visual C++ x86...
if exist "%TEMP_DIR%\vc_x86.exe" (
"%TEMP_DIR%\vc_x86.exe" /quiet /norestart
echo x86 installed successfully
) else (
echo x86 download failed
)
)
echo.
echo Step 5: Cleaning up...
if exist "%TEMP_DIR%\vc_x64.exe" del "%TEMP_DIR%\vc_x64.exe"
if exist "%TEMP_DIR%\vc_x86.exe" del "%TEMP_DIR%\vc_x86.exe"
echo.
echo ===================================
echo Installation Complete!
echo ===================================
echo Visual C++ Redistributable installed
echo This should fix MSVCP140_2.dll error
echo.
echo Please restart your computer
echo ===================================
echo Press any key to exit...
pause >nul
如果这个不行就下载安装虫虫编辑器
977

被折叠的 条评论
为什么被折叠?



