@echo off
title Win7_补丁检查工具_v10.22
color 2f

:Delupdates
del /s /q Windows6.1-KB2536276-x64.msu
del /s /q Windows6.1-KB2536276-x86.msu
del /s /q Windows6.1-KB2506928-x64.msu
del /s /q Windows6.1-KB2506928-x86.msu
del /s /q Windows6.1-KB2640148-x64.msu
del /s /q Windows6.1-KB2640148-x86.msu
del /s /q Windows6.1-KB2679255-x64.msu
del /s /q Windows6.1-KB2679255-x86.msu
del /s /q Windows6.1-KB982018-x64.msu
del /s /q Windows6.1-KB982018-x86.msu
del /s /q Windows6.1-KB982018-v2-x64.msu
del /s /q Windows6.1-KB982018-v2-x86.msu
del /s /q Windows6.1-KB2699779-x64.msu
del /s /q Windows6.1-KB2699779-x86.msu
del /s /q Windows6.1-KB2656373-x64.msu
del /s /q Windows6.1-KB2656373-x86.msu
del /s /q Windows6.1-KB2667402-x64.msu
del /s /q Windows6.1-KB2667402-x86.msu
del /s /q Windows6.1-KB2709981-x64.msu
del /s /q Windows6.1-KB2709981-x86.msu
del /s /q Windows6.1-KB2647753-x64.msu
del /s /q Windows6.1-KB2647753-x86.msu
del /s /q Windows6.1-KB2732059-v4-x64.msu
del /s /q Windows6.1-KB2732059-v4-x86.msu
del /s /q Windows6.1-KB2646886-x64.msu
del /s /q Windows6.1-KB2646886-x86.msu
del /s /q Windows6.1-KB947821-v21-x64.msu
del /s /q Windows6.1-KB947821-v21-x86.msu
del /s /q Windows6.1-KB947821-v22-x64.msu
del /s /q Windows6.1-KB947821-v22-x86.msu
del /s /q Windows6.1-KB947821-v23-x64.msu
del /s /q Windows6.1-KB947821-v23-x86.msu
del /s /q NDP40-KB2468871-x64.exe
del /s /q NDP40-KB2468871-x86.exe
rem 2011年11月：
del /s /q Windows6.1-KB2633952-x64.msu
del /s /q Windows6.1-KB2633952-x86.msu
rem 2011年12月：
del /s /q NDP40-KB2656351-x64.exe
del /s /q NDP40-KB2656351-x86.exe
rem 2012年2月：
del /s /q Windows6.1-KB2647516-x64.msu
del /s /q Windows6.1-KB2647516-x86.msu
del /s /q IE9-Windows6.1-KB2647516-x64.msu
del /s /q IE9-Windows6.1-KB2647516-x86.msu
rem 2012年4月：
del /s /q IE9-Windows6.1-KB2675157-x64.msu
del /s /q IE9-Windows6.1-KB2675157-x86.msu
rem 2012年6月：
del /s /q IE9-Windows6.1-KB2699988-x64.msu
del /s /q IE9-Windows6.1-KB2699988-x86.msu
rem 2012年8月：
del /s /q Windows6.1-KB2729094-x64.msu
del /s /q Windows6.1-KB2729094-x86.msu
del /s /q Windows6.1-KB2705219-x64.msu
del /s /q Windows6.1-KB2705219-x86.msu
del /s /q Windows6.1-KB2731847-x64.msu
del /s /q Windows6.1-KB2731847-x86.msu
del /s /q Windows6.1-KB2732487-x64.msu
del /s /q Windows6.1-KB2732487-x86.msu
del /s /q Windows6.1-KB2732500-x64.msu
del /s /q Windows6.1-KB2732500-x86.msu
del /s /q IE9-Windows6.1-KB2722913-x64.msu
del /s /q IE9-Windows6.1-KB2722913-x86.msu
rem 2012年9月：
del /s /q IE9-Windows6.1-KB2744842-x64.msu
del /s /q IE9-Windows6.1-KB2744842-x86.msu
del /s /q Windows6.1-KB947821-v24-x64.msu
del /s /q Windows6.1-KB947821-v24-x86.msu
rem 2012年10月：
del /s /q Windows6.1-KB2574819-x64.msu
del /s /q Windows6.1-KB2574819-x86.msu
rem 2012年11月：
del /s /q Windows6.1-KB947821-v25-x64.msu
del /s /q Windows6.1-KB947821-v25-x86.msu
rem 2012年12月：
del /s /q IE9-Windows6.1-KB2761451-x64.msu
del /s /q IE9-Windows6.1-KB2761451-x86.msu
del /s /q IE9-Windows6.1-KB2761465-x64.msu
del /s /q IE9-Windows6.1-KB2761465-x86.msu
del /s /q Windows6.1-KB2753842-x64.msu
del /s /q Windows6.1-KB2753842-x86.msu
del /s /q Windows6.1-KB2753842-v2-x64.msu
del /s /q Windows6.1-KB2753842-v2-x86.msu
rem 2013年2月：
del /s /q IE10-Windows6.1-KB2792100-x64.msu
del /s /q IE10-Windows6.1-KB2792100-x86.msu
del /s /q IE9-Windows6.1-KB2792100-x64.msu
del /s /q IE9-Windows6.1-KB2792100-x86.msu
del /s /q Windows6.1-KB2792100-x64.msu
del /s /q Windows6.1-KB2792100-x86.msu
del /s /q Windows6.1-KB947821-v26-x64.msu
del /s /q Windows6.1-KB947821-v26-x86.msu
rem 2013年3月：
del /s /q IE10-Windows6.1-KB2809289-x64.msu
del /s /q IE10-Windows6.1-KB2809289-x86.msu
del /s /q IE9-Windows6.1-KB2809289-x64.msu
del /s /q IE9-Windows6.1-KB2809289-x86.msu
del /s /q Windows6.1-KB2809289-x64.msu
del /s /q Windows6.1-KB2809289-x86.msu
rem 2013年4月：
del /s /q IE9-Windows6.1-KB2817183-x64.msu
del /s /q IE9-Windows6.1-KB2817183-x86.msu
del /s /q Windows6.1-KB2823324-x64.msu
del /s /q Windows6.1-KB2823324-x86.msu
rem 2013年5月：
del /s /q IE9-Windows6.1-KB2829530-x64.msu
del /s /q IE9-Windows6.1-KB2829530-x86.msu
del /s /q Windows6.1-KB947821-v27-x64.msu
del /s /q Windows6.1-KB947821-v27-x86.msu
del /s /q Windows6.1-KB2804579-x64.msu
del /s /q Windows6.1-KB2804579-x86.msu
del /s /q Windows6.1-KB2830290-x64.msu
del /s /q Windows6.1-KB2830290-x86.msu
del /s /q NDP40-KB2804576-x64.exe
del /s /q NDP40-KB2804576-x86.exe
rem 2013年6月：
del /s /q IE9-Windows6.1-KB2838727-x64.msu
del /s /q IE9-Windows6.1-KB2838727-x86.msu
del /s /q Windows6.1-KB2836943-x64.msu
del /s /q Windows6.1-KB2836943-x86.msu
del /s /q Windows6.1-KB2834140-x64.msu
del /s /q Windows6.1-KB2834140-x86.msu
del /s /q NDP40-KB2836939-x64.exe
del /s /q NDP40-KB2836939-x86.exe
rem 2013年7月：
del /s /q IE9-Windows6.1-KB2846071-x64.msu
del /s /q IE9-Windows6.1-KB2846071-x86.msu
del /s /q Windows6.1-KB2803821-x64.msu
del /s /q Windows6.1-KB2803821-x86.msu
del /s /q Windows6.1-KB2835361-x64.msu
del /s /q Windows6.1-KB2835361-x86.msu
del /s /q Windows6.1-KB2844286-x64.msu
del /s /q Windows6.1-KB2844286-x86.msu
del /s /q NDP40-KB2840628-x64.exe
del /s /q NDP40-KB2840628-x86.exe
rem 2013年8月：
del /s /q IE9-Windows6.1-KB2862772-x64.msu
del /s /q IE9-Windows6.1-KB2862772-x86.msu
del /s /q NDP40-KB2836939-v2-x64.exe
del /s /q NDP40-KB2836939-v2-x86.exe
rem 2013年9月：
del /s /q IE10-Windows6.1-KB2870699-x64.msu
del /s /q IE10-Windows6.1-KB2870699-x86.msu
del /s /q IE9-Windows6.1-KB2870699-x64.msu
del /s /q IE9-Windows6.1-KB2870699-x86.msu
del /s /q Windows6.1-KB2876315-x64.msu
del /s /q Windows6.1-KB2876315-x86.msu
rem 2013年10月：
del /s /q Windows6.1-KB2864058-x64.msu
del /s /q Windows6.1-KB2864058-x86.msu
rem 未知年月：
del /s /q NDP40-KB2858302-x64.exe
del /s /q NDP40-KB2858302-x86.exe
rem 删除 IE9 相关：
del /s /q IE9-Windows6.1-KB2797052-x64.msu
del /s /q IE9-Windows6.1-KB2797052-x86.msu
del /s /q IE9-Windows6.1-KB2847204-x64.msu
del /s /q IE9-Windows6.1-KB2847204-x86.msu
rd /s /q .\Win7_x64\x64_Win7_sp1_IE9
rd /s /q .\Win7_x86\x86_Win7_sp1_IE9
rem 一般用不到这几个补丁，暂时删除：
del /s /q NDP40-KB2836939-IA64.exe
del /s /q NDP40-KB2835393-IA64.exe
del /s /q NDP40-KB2840628-IA64.exe
del /s /q vcredist_IA64.exe
del /s /q IE10-Windows6.1-KB2797052-x64.msu
del /s /q IE10-Windows6.1-KB2797052-x86.msu

if exist msunet.hot del /f /q msunet.hot
if exist down.txt del /f /q down.txt
if exist temp.txt del /f /q temp.txt
if exist Win7_补丁地址列表.txt.txt ren Win7_补丁地址列表.txt.txt Win7_补丁地址列表.txt

:MENU
color 2f
ECHO.
ECHO.
ECHO.
ECHO.                         无用补丁已经删除  下一步 检查补丁
ECHO.
ECHO.
ECHO.                       =-=-=-=-=请选择要执行的项目=-=-=-=-=
ECHO.
ECHO.
ECHO.
ECHO.                       1  检查 Win7_x64 补丁
ECHO.
ECHO.                       2  整理 Win7_x64 补丁
ECHO.
ECHO.                       3  检查 Win7_x86 补丁
ECHO.
ECHO.                       4  整理 Win7_x86 补丁
ECHO.
ECHO.                       5  退   出
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
choice /C 123456789 /N /M 请输入选择项目的序号：
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO Checkx64
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO Arrangementx64
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 GOTO Checkx86
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 GOTO Arrangementx86
IF ERRORLEVEL 5 exit
PAUSE


:Checkx64
if not exist .\Win7_x64 md Win7_x64

if not exist .\Win7_x64\x64_Win7_sp1_IE10 md Win7_x64\x64_Win7_sp1_IE10

if not exist .\Win7_x64\x64_Win7_sp1_NET-Framework md Win7_x64\x64_Win7_sp1_NET-Framework
if not exist .\Win7_x64\x64_Win7_sp1_NET-Framework\1_NDP40 md Win7_x64\x64_Win7_sp1_NET-Framework\1_NDP40
if not exist .\Win7_x64\x64_Win7_sp1_NET-Framework\2_NDP40 md Win7_x64\x64_Win7_sp1_NET-Framework\2_NDP40

if not exist .\Win7_x64\x64_Win7_sp1_VC++ md Win7_x64\x64_Win7_sp1_VC++

if not exist .\Win7_x64\IE10-Windows6.1-x64-zh-cn.exe move .\Win7_x64\x64_Win7_sp1_IE10\IE10-Windows6.1-x64-zh-cn.exe .\Win7_x64\
if not exist .\Win7_x64\Silverlight_x64.exe move .\Win7_x64\x64_Win7_sp1_IE10\Silverlight_x64.exe .\Win7_x64\

if not exist .\Win7_x64\dotNetFx40_Client_x86_x64.exe move .\Win7_x64\x64_Win7_sp1_NET-Framework\dotNetFx40_Client_x86_x64.exe .\Win7_x64\
move .\Win7_x64\x64_Win7_sp1_NET-Framework\1_NDP40\NDP40-KB*-x64.exe .\Win7_x64\
move .\Win7_x64\x64_Win7_sp1_NET-Framework\2_NDP40\NDP40-KB*-x64.exe .\Win7_x64\

if not exist .\Win7_x64\*vcredist_x64.exe move .\Win7_x64\x64_Win7_sp1_VC++\*vcredist_x64.exe .\Win7_x64\
if not exist .\Win7_x64\*vcredist_x86.exe move .\Win7_x64\x64_Win7_sp1_VC++\*vcredist_x86.exe .\Win7_x64\

if exist 需要下载的补丁Win7_x64.txt del /f /q  需要下载的补丁Win7_x64.txt

rem 先看看这个文件有没有缺失，判断后提示
if not exist Win7_补丁地址列表.txt GOTO ERRdizhi

rem 处理 Win7_补丁地址列表.txt
FINDSTR /I /C:"http://download.microsoft.com/download/" Win7_补丁地址列表.txt >Tempw7ul

rem 把所有文件名输出到 msunet.hot 中，忽略子文件夹
dir .\Win7_x64\*-x64.msu /b >msunet.hot
dir .\Win7_x64\*-x64-chs.exe /b >>msunet.hot
dir .\Win7_x64\*-x64-zh-cn.exe /b >>msunet.hot
dir .\Win7_x64\*-x64.exe /b >>msunet.hot
dir .\Win7_x64\*_x64.exe /b >>msunet.hot
dir .\Win7_x64\vcredist_x86.exe /b >>msunet.hot

Echo -x64.msu>temp.txt
Echo -x64-chs.exe>>temp.txt
Echo -x64-zh-cn.exe>>temp.txt
Echo -x64.exe>>temp.txt
Echo _x64.exe>>temp.txt
Echo vcredist_x86.exe>>temp.txt
rem 如果 msunet.hot 等于零，则没有执行文件，所有的补丁都需要下载
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a equ 0 FINDSTR /I /G:temp.txt Tempw7ul >需要下载的补丁Win7_x64.txt)
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a equ 0 cls)
if exist temp.txt del /f /q temp.txt
if exist Tempw7ul del /f /q Tempw7ul
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                        Win7_x64 目录下没有任何补丁
Echo.
Echo                   请把 Win7_x64 位补丁放到 Win7_x64 目录下
Echo.
Echo.
Echo             如果您没有 Win7_x64 位补丁，请参考“需要下载的补丁Win7_x64”
Echo. 
Echo                 下载缺失补丁，并放到 Win7_x64 目录，再次执行检查
Echo.
Echo.
Echo                               按任意键返回......
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a equ 0 del /f /q msunet.hot)
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x64.txt ^| find "1 个文件"') do ( if %%a gtr 0 pause>nul)
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x64.txt ^| find "1 个文件"') do ( if %%a gtr 0 GOTO MENU)

rem 处理 Win7_补丁地址列表.txt
FINDSTR /I /C:"http://download.microsoft.com/download/" Win7_补丁地址列表.txt >Tempw7ul

rem 如果 msunet.hot 大于零，则把其中的文件列表和地址列表对比，如果有缺失的就输出到down.txt
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a gtr 0 FINDSTR /V /I /G:msunet.hot Tempw7ul >down.txt)

Echo -x64.msu>temp.txt
Echo -x64-chs.exe>>temp.txt
Echo -x64-zh-cn.exe>>temp.txt
Echo -x64.exe>>temp.txt
Echo _x64.exe>>temp.txt
Echo vcredist_x86.exe>>temp.txt
for /f "tokens=3 delims= " %%a in ('dir /-c down.txt ^| find "1 个文件"') do ( if %%a equ 0 FINDSTR /I /G:temp.txt down.txt >需要下载的补丁Win7_x64.txt)
for /f "tokens=3 delims= " %%a in ('dir /-c down.txt ^| find "1 个文件"') do ( if %%a gtr 0 FINDSTR /I /G:temp.txt down.txt >需要下载的补丁Win7_x64.txt)
if exist temp.txt del /f /q temp.txt
if exist msunet.hot del /f /q msunet.hot
if exist down.txt del /f /q down.txt
if exist Tempw7ul del /f /q Tempw7ul
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                         没有需要下载的 Win7_x64 位补丁
Echo.
Echo                           按任意键返回……  整理补丁
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x64.txt ^| find "1 个文件"') do ( if %%a equ 0 pause>nul)
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x64.txt ^| find "1 个文件"') do ( if %%a equ 0 del /f /q 需要下载的补丁Win7_x64.txt)
if not exist 需要下载的补丁Win7_x64.txt GOTO MENU

rem  判断 需要下载的补丁Win7_x64.txt 是否为0（空文件），为空表示没有需要下载的补丁文件，否则就是有需要下载的补丁文件，如果有需要下载就提示。
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                                 补丁文件不全
Echo.
Echo                       请参考“需要下载的补丁Win7_x64”
Echo. 
Echo             下载缺失补丁，并复制到 Win7_x64 目录，再次执行检查
Echo.
Echo.
Echo                               请按任意键返回......
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
if exist msunet.hot del /f /q msunet.hot
if exist down.txt del /f /q down.txt
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x64.txt ^| find "1 个文件"') do ( if %%a gtr 0 pause>nul)
GOTO MENU


:Checkx86
if not exist .\Win7_x86 md Win7_x86

if not exist .\Win7_x86\x86_Win7_sp1_IE10 md Win7_x86\x86_Win7_sp1_IE10

if not exist .\Win7_x86\x86_Win7_sp1_NET-Framework md Win7_x86\x86_Win7_sp1_NET-Framework
if not exist .\Win7_x86\x86_Win7_sp1_NET-Framework\1_NDP40 md Win7_x86\x86_Win7_sp1_NET-Framework\1_NDP40
if not exist .\Win7_x86\x86_Win7_sp1_NET-Framework\2_NDP40 md Win7_x86\x86_Win7_sp1_NET-Framework\2_NDP40

if not exist .\Win7_x86\x86_Win7_sp1_VC++ md Win7_x86\x86_Win7_sp1_VC++

if not exist .\Win7_x86\IE10-Windows6.1-x86-zh-cn.exe move .\Win7_x86\x86_Win7_sp1_IE10\IE10-Windows6.1-x86-zh-cn.exe .\Win7_x86\
if not exist .\Win7_x86\Silverlight.exe move .\Win7_x86\x86_Win7_sp1_IE10\Silverlight.exe .\Win7_x86\

if not exist .\Win7_x86\dotNetFx40_Client_x86_x64.exe move .\Win7_x86\x86_Win7_sp1_NET-Framework\dotNetFx40_Client_x86_x64.exe .\Win7_x86\
move .\Win7_x86\x86_Win7_sp1_NET-Framework\1_NDP40\NDP40-KB*-x86.exe .\Win7_x86\
move .\Win7_x86\x86_Win7_sp1_NET-Framework\2_NDP40\NDP40-KB*-x86.exe .\Win7_x86\

if not exist .\Win7_x86\*vcredist_x86.exe move .\Win7_x86\x86_Win7_sp1_VC++\*vcredist_x86.exe .\Win7_x86\

if exist 需要下载的补丁Win7_x86.txt del /f /q  需要下载的补丁Win7_x86.txt

rem 先看看这个文件有没有缺失，判断后提示
if not exist Win7_补丁地址列表.txt GOTO ERRdizhi

rem 处理 Win7_补丁地址列表.txt
FINDSTR /I /C:"http://download.microsoft.com/download/" Win7_补丁地址列表.txt >Tempw7ul

rem 把所有文件名输出到 msunet.hot 中，忽略子文件夹
dir .\Win7_x86\*-x86.msu /b >msunet.hot
dir .\Win7_x86\*-x86-chs.exe /b >>msunet.hot
dir .\Win7_x86\*-x86-zh-cn.exe /b >>msunet.hot
dir .\Win7_x86\*-x86.exe /b >>msunet.hot
dir .\Win7_x86\*_x86.exe /b >>msunet.hot
dir .\Win7_x86\*_x86_x64.exe /b >>msunet.hot
dir .\Win7_x86\*ght.exe /b >>msunet.hot

Echo -x86.msu>temp.txt
Echo -x86-chs.exe>>temp.txt
Echo -x86-zh-cn.exe>>temp.txt
Echo -x86.exe>>temp.txt
Echo _x86.exe>>temp.txt
Echo _x86_x64.exe>>temp.txt
Echo ght.exe>>temp.txt
rem 如果 msunet.hot 等于零，则没有执行文件，所有的补丁都需要下载
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a equ 0 FINDSTR /I /G:temp.txt Tempw7ul >需要下载的补丁Win7_x86.txt)
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a equ 0 cls)
if exist temp.txt del /f /q temp.txt
if exist Tempw7ul del /f /q Tempw7ul
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                        Win7_x86 目录下没有任何补丁
Echo.
Echo                   请把 Win7_x86 位补丁放到 Win7_x86 目录下
Echo.
Echo.
Echo             如果您没有 Win7_x86 位补丁，请参考“需要下载的补丁Win7_x86”
Echo. 
Echo                 下载缺失补丁，并放到 Win7_x86 目录，再次执行检查
Echo.
Echo.
Echo                               按任意键返回......
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a equ 0 del /f /q msunet.hot)
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x86.txt ^| find "1 个文件"') do ( if %%a gtr 0 pause>nul)
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x86.txt ^| find "1 个文件"') do ( if %%a gtr 0 GOTO MENU)

rem 处理 Win7_补丁地址列表.txt
FINDSTR /I /C:"http://download.microsoft.com/download/" Win7_补丁地址列表.txt >Tempw7ul

rem 如果 msunet.hot 大于零，则把其中的文件列表和地址列表对比，如果有缺失的就输出到down.txt
for /f "tokens=3 delims= " %%a in ('dir /-c msunet.hot ^| find "1 个文件"') do ( if %%a gtr 0 FINDSTR /V /I /G:msunet.hot Tempw7ul >down.txt)

Echo -x86.msu>temp.txt
Echo -x86-chs.exe>>temp.txt
Echo -x86-zh-cn.exe>>temp.txt
Echo -x86.exe>>temp.txt
Echo _x86.exe>>temp.txt
Echo _x86_x64.exe>>temp.txt
Echo ght.exe>>temp.txt
for /f "tokens=3 delims= " %%a in ('dir /-c down.txt ^| find "1 个文件"') do ( if %%a equ 0 FINDSTR /I /G:temp.txt down.txt >需要下载的补丁Win7_x86.txt)
for /f "tokens=3 delims= " %%a in ('dir /-c down.txt ^| find "1 个文件"') do ( if %%a gtr 0 FINDSTR /I /G:temp.txt down.txt >需要下载的补丁Win7_x86.txt)
if exist temp.txt del /f /q temp.txt
if exist msunet.hot del /f /q msunet.hot
if exist down.txt del /f /q down.txt
if exist Tempw7ul del /f /q Tempw7ul
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                         没有需要下载的 Win7_x86 位补丁
Echo.
Echo                           按任意键返回……  整理补丁
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x86.txt ^| find "1 个文件"') do ( if %%a equ 0 pause>nul)
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x86.txt ^| find "1 个文件"') do ( if %%a equ 0 del /f /q 需要下载的补丁Win7_x86.txt)
if not exist 需要下载的补丁Win7_x86.txt GOTO MENU

rem  判断 需要下载的补丁Win7_x86.txt 是否为0（空文件），为空表示没有需要下载的补丁文件，否则就是有需要下载的补丁文件，如果有需要下载就提示。
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                                 补丁文件不全
Echo.
Echo                       请参考“需要下载的补丁Win7_x86”
Echo. 
Echo             下载缺失补丁，并复制到 Win7_x86 目录，再次执行检查
Echo.
Echo.
Echo                               请按任意键返回......
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
if exist msunet.hot del /f /q msunet.hot
if exist down.txt del /f /q down.txt
for /f "tokens=3 delims= " %%a in ('dir /-c 需要下载的补丁Win7_x86.txt ^| find "1 个文件"') do ( if %%a gtr 0 pause>nul)
GOTO MENU

:Arrangementx64
move .\Win7_x64\IE10-Windows6.1-x64-zh-cn.exe .\Win7_x64\x64_Win7_sp1_IE10\
move .\Win7_x64\Silverlight_x64.exe .\Win7_x64\x64_Win7_sp1_IE10\

move .\Win7_x64\dotNetFx40_Client_x86_x64.exe .\Win7_x64\x64_Win7_sp1_NET-Framework\
move .\Win7_x64\NDP40-KB246*-x64.exe .\Win7_x64\x64_Win7_sp1_NET-Framework\1_NDP40\
move .\Win7_x64\NDP40-KB253*-x64.exe .\Win7_x64\x64_Win7_sp1_NET-Framework\1_NDP40\
move .\Win7_x64\NDP40-KB26*-x64.exe .\Win7_x64\x64_Win7_sp1_NET-Framework\2_NDP40\
move .\Win7_x64\NDP40-KB27*-x64.exe .\Win7_x64\x64_Win7_sp1_NET-Framework\2_NDP40\
move .\Win7_x64\NDP40-KB28*-x64.exe .\Win7_x64\x64_Win7_sp1_NET-Framework\2_NDP40\

move .\Win7_x64\*vcredist_x64.exe .\Win7_x64\x64_Win7_sp1_VC++\
move .\Win7_x64\*vcredist_x86.exe .\Win7_x64\x64_Win7_sp1_VC++\

copy /y ".\Win7_x64\Windows6.1-KB2834140*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"
copy /y ".\Win7_x64\Windows6.1-KB2639308*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"
copy /y ".\Win7_x64\Windows6.1-KB2729094*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"
copy /y ".\Win7_x64\Windows6.1-KB2731771*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"
copy /y ".\Win7_x64\Windows6.1-KB2533623*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"
copy /y ".\Win7_x64\Windows6.1-KB2670838*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"
copy /y ".\Win7_x64\Windows6.1-KB2786081*x64.msu" ".\Win7_x64\x64_Win7_sp1_IE10\"

Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                              Win7_x64 补丁整理完毕
Echo.
Echo                              然后依照顺序 安装补丁
Echo.
Echo                                 欢迎建议   谢谢
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
pause>nul|Echo 按任意键返回……
GOTO MENU

:Arrangementx86
move .\Win7_x86\IE10-Windows6.1-x86-zh-cn.exe .\Win7_x86\x86_Win7_sp1_IE10\
move .\Win7_x86\Silverlight.exe .\Win7_x86\x86_Win7_sp1_IE10\

move .\Win7_x86\dotNetFx40_Client_x86_x64.exe .\Win7_x86\x86_Win7_sp1_NET-Framework\
move .\Win7_x86\NDP40-KB246*-x86.exe .\Win7_x86\x86_Win7_sp1_NET-Framework\1_NDP40\
move .\Win7_x86\NDP40-KB253*-x86.exe .\Win7_x86\x86_Win7_sp1_NET-Framework\1_NDP40\
move .\Win7_x86\NDP40-KB26*-x86.exe .\Win7_x86\x86_Win7_sp1_NET-Framework\2_NDP40\
move .\Win7_x86\NDP40-KB27*-x86.exe .\Win7_x86\x86_Win7_sp1_NET-Framework\2_NDP40\
move .\Win7_x86\NDP40-KB28*-x86.exe .\Win7_x86\x86_Win7_sp1_NET-Framework\2_NDP40\

move .\Win7_x86\*vcredist_x86.exe .\Win7_x86\x86_Win7_sp1_VC++\

copy /y ".\Win7_x86\Windows6.1-KB2834140*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"
copy /y ".\Win7_x86\Windows6.1-KB2639308*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"
copy /y ".\Win7_x86\Windows6.1-KB2729094*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"
copy /y ".\Win7_x86\Windows6.1-KB2731771*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"
copy /y ".\Win7_x86\Windows6.1-KB2533623*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"
copy /y ".\Win7_x86\Windows6.1-KB2670838*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"
copy /y ".\Win7_x86\Windows6.1-KB2786081*x86.msu" ".\Win7_x86\x86_Win7_sp1_IE10\"

Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo                              Win7_x86 补丁整理完毕
Echo.
Echo                              然后依照顺序 安装补丁
Echo.
Echo                                 欢迎建议   谢谢
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
pause>nul|Echo 按任意键返回……
GOTO MENU

:ERRdizhi
color 1a
cls
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
Echo                        “Win7_补丁地址列表.txt”文件缺失
ECHO.
Echo                     请到本帖一楼下载“Win7_补丁地址列表.txt”
ECHO.
Echo                                  按任意键返回……
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
pause>nul
GOTO MENU
