herms14 0 Light Poster

Hi Guys,

I just would like to ask for some advice on my script. I am trying to get all MS hotfixes installed in a server using WMIC. I have a text file called patches.txt that contains all the hotfixid's and I want it to validate if it is installed on a remote server using this code

FOR /F  %%G IN (patch.txt) DO (wmic /user: "DOMAIN\USERNAME" /password:"PASSWORD" /node: xx.xx.x qfe where hotfixid='%%G' list full    /format:htable > C:\WindowsPatches.htm)

Both the for loop and WMIC codes are working but when I combine them, a error occurs.

Here is an example of the problem:

patches.txt contains

KB2079403
KB2115168

When I run the command, I am expecting to have a result like

Node Caption CSName Description FixComments HotFixID InstallDate InstalledBy InstalledOn Name ServicePackInEffect Status

10.99.99.36 . BMGDCNT036. . . File 1. . . . . KB2079403. .
10.99.99.36 . BMGDCNT036. . . File 1. . . . . KB2115168. .


I believe I am just missing something here..can anyone help? thanks