2

i need this to uninstall the first KB then wait until that's finished then move to uninstall the next KB, how do i do that?

i'll put the batch file already formatted somewhere so some other poor soul doesn't have to retype all that crap... :) for the other people looking to quickly uninstall a lot of updates. i prefer to look through all my updates and check for compatibility with my currently installed programs, all these updates got installed when a careless user activated the "automatically download and install" option in windows 7, windows update. there are about 100 of them so i don't want to click each prompt individually... ("careless user" he's about 2 feet tall, 3 yrs old and just learning that clicking on things does stuff....)

wusa /uninstall /kb:KB2532531 /passive /norestart

wusa /uninstall /kb:KB2598845 /passive /norestart

wusa /uninstall /kb:KB2732487 /passive /norestart

wusa /uninstall /kb:KB2846960 /passive /norestart

wusa /uninstall /kb:KB2852386 /passive /norestart

wusa /uninstall /kb:KB2861191 /passive /norestart
Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
user2867220
  • 21
  • 1
  • 2

3 Answers3

2

The stuff on this page doesn't work for me, so I changed it a bit so it would work. I had to change /passive to /quiet because there is no /passive parameter on mine. I also got rid of @echo off because I don't understand why people use it in cases like this, where having echo off completely removes all signs of progress which means I can't monitor what it is doing. Here is what worked fro me:

for %%a in (
2844286
2847311
2849470
) do start "" /w wusa /uninstall /kb:%%a /quiet /norestart

I used this to uninstall 71 updates at once. Another thing I changed from the code above is the KB in front of each number. I had to get rid of that for this to work for me. I'm not sure why mine is different, but for anyone who gets errors using the other code, try this.

Math
  • 3,334
  • 4
  • 36
  • 51
  • For reference, here is a similar post on superuser.com: http://superuser.com/questions/746799/how-can-i-install-hotfixes-silently-to-speed-up-a-fresh-windows-7-installation and one on stackoverflow: http://stackoverflow.com/questions/23378401/discovering-command-line-switches – Stein Åsmul May 27 '14 at 19:51
1

Here is the one I used for windows server 2008 R2. Just save the script as a .bat file and double click it to run it. Just change the 7 digit numbers between the parentheses to the KBXXXXXX that you want to uninstall. I wanted to see it run so I didn't worry about the echo. Saved a bunch of time.

for %%a in (
2820331
2834140
) do start "" /w wusa /uninstall /kb:%%a /quiet /norestart
END
0

Using your command line, then the start "" /w will do one at a time as they terminate.

@echo off
for %%a in (
KB2532531
KB2598845
KB2732487
KB2846960
KB2852386
KB2861191
) do start "" /w wusa /uninstall /kb:%%a /passive /norestart
foxidrive
  • 40,353
  • 10
  • 53
  • 68
  • i don't quite understand what that means, do i replace all the numbers with %%a ? or will start "" /w wusa /uninstall /kb:KB2852386 /quiet /norestart work? – user2867220 Oct 10 '13 at 14:29
  • i tried it both ways however it keeps telling me i need the field, which is the full path to the MSU file, i'm not sure where to find that – user2867220 Oct 10 '13 at 14:36
  • The code replaces each KB number, as listed, into the %%a replaceable parameter and runs the command. I don't know what error you are getting as I just used the command line you showed. – foxidrive Oct 10 '13 at 14:41