I have been trying to get a batch file to work but I have been unsuccessful; maybe someone can assist. I have a batch file that reads a text document that's in the same folder and named KB-list.txt whihc is a list of Window KB's that are to be scanned, if any of these are present on the PC I want it to uninstall.
Please find the code I created below, the search works fine its when it finds one that doesn't work it just shows that it was found.
@echo off setlocal enabledelayedexpansion echo "Hotfix & Updates list." Echo. (for /f %%a in ('type c:\KB-list.txt') do ( echo "Searching For KB%%a" Echo. systeminfo | findstr KB%%a )) for /f %%i in ('type C:\KB-list.txt') do ( echo "Uninstalling KB%%i" wusa /uninstall /kb:%%i /quiet /norestart ) echo "Uninstall(s) Complete." echo. echo "Done" echo. echo "Rebooting…" echo. shutdown /r