Install CAB files

Posted on May 15, 2009. Filed under: Tips & Tricks | Tags: , , |

Here is how to install .cab files that you get from Windows updates. Put the lines below in a .bat file. And use command prompt to input the .cab file to this .bat program as argument. For example, if the lines below are saved in cabinst.bat, put this .bat file in the folder of the .cab file. And traverse to this folder in cmd. Enter cabinst.bat file.cab

 

 

@echo off 
setlocal 
Set “TempDir=cabtmp” 
Set “Log=Log.txt” 
mkdir “%TempDir%” 
For %%i In (*.cab) Do ( 
expand “%%i” -f:* “%TempDir%” && Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” expansion – OK || Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” expansion – FAIL 
Echo – – – – – – – – – – – – – – – 
Echo Installing %%i%. Please wait. 
pkgmgr /ip /m:”%TempDir%” && Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” installation – OK || Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” installation – FAIL 
del /f /s /q “%TempDir%” 
rd /s /q “%TempDir%” 
Echo – – – – – – – – – – – – – – – 
Echo Operation completed 
Echo Log file created as %Log% 
Echo System log can be found at %WINDIR%\logs\cbs\Cbs.log 
Echo Now you may close this window 
pause 
(To put this .bat file into the temp-folder with .cab-file )
For MSU&CAB-files
@Echo Off
Title Installing Windows Vista Updates
For %%F In (MSU\*.msu) Do Call :msin %%F
For %%A In (CAB\*.cab) Do Call :kbin %%A
Shutdown.exe -r -t 1
Exit
:msin
Start /Wait %1 /quiet /norestart
:kbin
Start /Wait pkgmgr /ip /m:%1 /quiet /norestart
GoTo :EOF
Exit

@echo off 

setlocal 

Set “TempDir=cabtmp” 

Set “Log=Log.txt” 

mkdir “%TempDir%” 

For %%i In (*.cab) Do ( 

expand “%%i” -f:* “%TempDir%” && Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” expansion – OK || Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” expansion – FAIL 

Echo – – – – – – – – – – – – – – – 

Echo Installing %%i%. Please wait. 

pkgmgr /ip /m:”%TempDir%” && Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” installation – OK || Echo>> “%Log%” %Time:~0,-3%^>^> “%%i” installation – FAIL 

del /f /s /q “%TempDir%” 

rd /s /q “%TempDir%” 

Echo – – – – – – – – – – – – – – – 

Echo Operation completed 

Echo Log file created as %Log% 

Echo System log can be found at %WINDIR%\logs\cbs\Cbs.log 

Echo Now you may close this window 

pause 

 

(To put this .bat file into the temp-folder with .cab-file )

 

 

For MSU&CAB-files

 

@Echo Off

Title Installing Windows Vista Updates

For %%F In (MSU\*.msu) Do Call :msin %%F

For %%A In (CAB\*.cab) Do Call :kbin %%A

Shutdown.exe -r -t 1

Exit

:msin

Start /Wait %1 /quiet /norestart

:kbin

Start /Wait pkgmgr /ip /m:%1 /quiet /norestart

GoTo :EOF

Exit

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: