2

I need help making a batch file that will create a folder and then extract a cabinet file from a Windows installer file and then run a DISM command to install said extracted update. Below is a list of the command to use but for the life of me I cannot figure out the batch command order to get it to work.

mkdir update
expand -f: Windows6.1-KB3112343-x64.msu .\update
cd update
dism /online /add-package /packagepath:Windows6.1-KB3112343-x64.cab

I would be using the command knowing the file is at C:/users/owner/desktop/Windows6.1-KB3112343-x64

I'll also be making the update folder on the desktop as well. I just want to automate this process as much as possible because I have many Windows 7 computers that I update and to start I usually need to do the above commands and I want to make it more efficient if I can.

clhy
  • 6,283
  • 8
  • 34
  • 66
  • Why use DISM to install an update to a live machine when you can run the `.msu` file? I would see the point if you were using DISM to service an offline image... p.s. what problem are you having with the script? – Kinnectus Jul 21 '16 at 04:21
  • A very large portion of the time when I run the Windows6.1-KB3112343-x64.msu it takes hours to run and I've found extracting the cab file takes 4-5 mintues roughly. I would just like to automate it further. Unfortunately I am not very good with batch so I'm running into issues going to the next steps after creating the update directory. In fact I am really just starting to learn batch and am looking for guidelines on how to proceed in making that batch file. – James Petrozzo Jul 21 '16 at 04:31

1 Answers1

0

This question is a typical XY problem. You tried to fix the slow MSU install and this can be done by running this batch file. It stops the Windows Update service before trying to install a MSU update. This speeds up the installation a lot.

magicandre1981
  • 97,301
  • 30
  • 179
  • 245