next run on correcting msvc update
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
@Echo off
|
||||
SET VCDIR=%~dp0
|
||||
cd %VCDIR%\..
|
||||
SET SEDPARENTDIR=%cd%
|
||||
|
||||
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
|
||||
|
||||
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
|
||||
@@ -30,13 +34,14 @@ if exist "%temp%\list.txt" (del "%temp%\list.txt")
|
||||
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
|
||||
echo (please wait as this process may take a few moments)
|
||||
|
||||
|
||||
wmic product where "name like 'Microsoft Visual C++ 2005 Redistributable%%'" get name >>"%temp%\list.txt"
|
||||
|
||||
%SEDPARENTDIR%\sed\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt"
|
||||
|
||||
for /f "usebackq skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where name='%%a' call uninstall /nointeractive)
|
||||
|
||||
del "%temp%\list.txt"
|
||||
|
||||
"%windir%\system32\msiexec.exe" /i vcredist.msi /q transforms=2k5-x64.mst
|
||||
"%windir%\system32\msiexec.exe" /i %VCDIR%\vcredist.msi /q %VCDIR%\transforms=2k5-x64.mst
|
||||
|
||||
:eof
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
@Echo off
|
||||
SET VCDIR=%~dp0
|
||||
cd %VCDIR%\..
|
||||
SET SEDPARENTDIR=%cd%
|
||||
|
||||
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
|
||||
|
||||
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
|
||||
@@ -27,30 +31,17 @@ goto :eof
|
||||
|
||||
if exist "%temp%\list.txt" (del "%temp%\list.txt")
|
||||
|
||||
if %arch% neq x64 goto :x64skip
|
||||
echo Uninstalling existing Visual C++ x86 Runtime Redistributables
|
||||
echo (please wait as this process may take a few moments)
|
||||
|
||||
reg query hklm\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /f "Microsoft Visual C++ 2005 Redistributable" /s >>"%temp%\list.txt"
|
||||
wmic product where "name like 'Microsoft Visual C++ 2005 Redistributable - x86%%'" get name >>"%temp%\list.txt"
|
||||
|
||||
for /f "delims=\ tokens=8" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
|
||||
%SEDPARENTDIR%\sed\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt"
|
||||
|
||||
for /f "skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
|
||||
|
||||
del "%temp%\list.txt"
|
||||
|
||||
goto :install
|
||||
|
||||
:x64skip
|
||||
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
|
||||
echo (please wait as this process may take a few moments)
|
||||
|
||||
reg query hklm\software\microsoft\windows\currentversion\uninstall /f "Microsoft Visual C++ 2005 Redistributable" /s >>"%temp%\list.txt"
|
||||
|
||||
for /f "delims=\ tokens=7" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
|
||||
|
||||
del "%temp%\list.txt"
|
||||
|
||||
:install
|
||||
|
||||
"%windir%\system32\msiexec.exe" /i vcredist.msi /q transforms=2k5-x86.mst
|
||||
"%windir%\system32\msiexec.exe" /i %VCDIR%\vcredist.msi /q %VCDIR%\transforms=2k5-x86.mst
|
||||
|
||||
:eof
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
@Echo off
|
||||
SET VCDIR=%~dp0
|
||||
cd %VCDIR%\..
|
||||
SET SEDPARENTDIR=%cd%
|
||||
|
||||
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
|
||||
|
||||
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
|
||||
@@ -30,17 +34,14 @@ if exist "%temp%\list.txt" (del "%temp%\list.txt")
|
||||
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
|
||||
echo (please wait as this process may take a few moments)
|
||||
|
||||
rem reg query hklm\software\microsoft\windows\currentversion\uninstall /f "Microsoft Visual C++ 2008 Redistributable" /s >>"%temp%\list.txt"
|
||||
|
||||
rem for /f "delims=\ tokens=7" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
|
||||
|
||||
wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x64%%'" get name >>"%temp%\list.txt"
|
||||
|
||||
%SEDPARENTDIR%\sed\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt"
|
||||
|
||||
for /f "usebackq skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where name='%%a' call uninstall /nointeractive)
|
||||
|
||||
|
||||
del "%temp%\list.txt"
|
||||
|
||||
"%windir%\system32\msiexec.exe" /i vc_red.msi /q transforms=2k8-x64.mst
|
||||
"%windir%\system32\msiexec.exe" /i %VCDIR%\vc_red.msi /q %VCDIR%\transforms=2k8-x64.mst
|
||||
|
||||
:eof
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
rem @Echo off
|
||||
@Echo off
|
||||
SET VCDIR=%~dp0
|
||||
cd %VCDIR%\..
|
||||
SET SEDPARENTDIR=%cd%
|
||||
|
||||
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
|
||||
|
||||
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
|
||||
@@ -26,31 +30,18 @@ goto :eof
|
||||
:checkok
|
||||
|
||||
if exist "%temp%\list.txt" (del "%temp%\list.txt")
|
||||
if exist "%temp%\list1.txt" (del "%temp%\list1.txt")
|
||||
|
||||
echo Uninstalling existing Visual C++ x86 Runtime Redistributables
|
||||
echo (please wait as this process may take a few moments)
|
||||
|
||||
rem reg query hklm\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /f "Microsoft Visual C++ 2008 Redistributable" /s >>"%temp%\list.txt"
|
||||
|
||||
rem for /f "delims=\ tokens=8" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
|
||||
|
||||
wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x86%%'" get name >>"%temp%\list.txt"
|
||||
|
||||
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"
|
||||
)
|
||||
%SEDPARENTDIR%\sed\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt"
|
||||
|
||||
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")
|
||||
for /f "skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
|
||||
|
||||
del "%temp%\list.txt"
|
||||
del "%temp%\list1.txt"
|
||||
|
||||
rem "%windir%\system32\msiexec.exe" /i vc_red.msi /q transforms=2k8-x86.mst
|
||||
"%windir%\system32\msiexec.exe" /i %VCDIR%\vc_red.msi /q %VCDIR%\transforms=2k8-x86.mst
|
||||
|
||||
:eof
|
||||
|
||||
Reference in New Issue
Block a user