2014-02-06 11:35:05 +01:00
|
|
|
rem @Echo off
|
2014-02-01 14:36:38 +01:00
|
|
|
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
|
|
|
|
|
|
|
|
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
|
|
|
|
goto :checkok
|
|
|
|
) || (
|
|
|
|
echo -------
|
|
|
|
echo *** WARNING ***
|
|
|
|
echo -------
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo ADMINISTRATOR PRIVILEGES NOT DETECTED!
|
|
|
|
echo ______________________________________
|
|
|
|
echo.
|
|
|
|
echo This script must be able to run with administrator
|
|
|
|
echo privileges.
|
|
|
|
echo.
|
|
|
|
echo To do so, right click on this script and select 'Run As Administrator'
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo Press any key to exit...
|
|
|
|
pause >nul
|
|
|
|
goto :eof
|
|
|
|
)
|
|
|
|
|
|
|
|
:checkok
|
|
|
|
|
|
|
|
if exist "%temp%\list.txt" (del "%temp%\list.txt")
|
2014-02-06 11:35:05 +01:00
|
|
|
if exist "%temp%\list1.txt" (del "%temp%\list1.txt")
|
2014-02-01 14:36:38 +01:00
|
|
|
|
|
|
|
echo Uninstalling existing Visual C++ x86 Runtime Redistributables
|
|
|
|
echo (please wait as this process may take a few moments)
|
|
|
|
|
2014-02-06 11:35:05 +01:00
|
|
|
rem reg query hklm\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /f "Microsoft Visual C++ 2008 Redistributable" /s >>"%temp%\list.txt"
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-06 11:35:05 +01:00
|
|
|
rem for /f "delims=\ tokens=8" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-06 11:35:05 +01:00
|
|
|
wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x86%%'" get name >>"%temp%\list.txt"
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-06 11:35:05 +01:00
|
|
|
setLocal EnableDelayedExpansion
|
|
|
|
set name=%~1
|
|
|
|
for /f "tokens=* delims= " %%a in ('type "%temp%\list.txt"') do (
|
|
|
|
set str=%%a
|
|
|
|
set str=!str:###=%name%!
|
|
|
|
echo !str! >> "%temp%\list1.txt"
|
|
|
|
)
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-06 11:35:05 +01:00
|
|
|
for /f "skip=1 delims=" %%a in ('type "%temp%\list1.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
|
|
|
|
for /f "skip=1 delims=" %%a in ('type "%temp%\list1.txt"') do (echo "%%a")
|
2014-02-01 14:36:38 +01:00
|
|
|
|
|
|
|
del "%temp%\list.txt"
|
2014-02-06 11:35:05 +01:00
|
|
|
del "%temp%\list1.txt"
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-06 11:35:05 +01:00
|
|
|
rem "%windir%\system32\msiexec.exe" /i vc_red.msi /q transforms=2k8-x86.mst
|
2014-02-01 14:36:38 +01:00
|
|
|
|
|
|
|
:eof
|