2015-09-10 02:34:07 +00:00
|
|
|
@echo off
|
|
|
|
@setlocal EnableDelayedExpansion
|
|
|
|
|
|
|
|
@set arg=%~1
|
|
|
|
|
|
|
|
if [%arg%] == [] (
|
|
|
|
echo Argument Missing:
|
|
|
|
echo You must provide a directory that contains
|
|
|
|
echo all the Windows patches in *.msu format.
|
|
|
|
echo To Download patches manually, please go:
|
|
|
|
echo http://mybulletins.technet.microsoft.com/BulletinPages/Dashboard
|
|
|
|
exit /B
|
|
|
|
)
|
|
|
|
|
2015-09-16 18:43:11 +00:00
|
|
|
if not "!arg:~-1,1!" == "\" (
|
|
|
|
@set arg=!arg!\
|
|
|
|
)
|
|
|
|
|
2015-09-10 02:34:07 +00:00
|
|
|
|
|
|
|
for /f %%f in ('dir /B %arg%') DO (
|
|
|
|
@set fname=%%f
|
|
|
|
@set lastfourchars=!fname:~-4,4!
|
|
|
|
if "!lastfourchars!" == ".msu" (
|
|
|
|
@set newname=!fname:~0,-4!
|
2015-09-12 08:07:15 +00:00
|
|
|
mkdir %arg%!newname!
|
2015-09-10 03:00:35 +00:00
|
|
|
mkdir %arg%!newname!\extracted
|
2015-09-12 08:07:15 +00:00
|
|
|
expand /F:* %arg%!fname! %arg%!newname!
|
2015-09-10 03:00:35 +00:00
|
|
|
expand /F:* %arg%!newname!\!newname!.cab %arg%!newname!\extracted
|
2015-09-10 02:34:07 +00:00
|
|
|
)
|
2015-09-10 03:00:35 +00:00
|
|
|
|
2015-09-10 02:34:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echo Done!
|
|
|
|
echo Now go to %arg%,
|
|
|
|
echo and then use the search feature from Windows to
|
|
|
|
echo find the files you're interested in.
|