Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


msoff20xx

How to list all currently installed Win7 patches/updates?

24 posts in this topic

How can I list which of the available Win7 patches/updates from Microsoft are currently really applied and installed on the local Win7 system?

The list of patches/updates should cover updates for Offcie 2003/2007 as well.

How can I list the information?

Peter

0

Share this post


Link to post
Share on other sites

This is easy to do in VBScript or Powershell, but since VBScript is a little easier to understand and will work (relatively speaking) downlevel on stock XP/2003 and 2000 SP3 systems as well, I'll do it in VBScript:

'// Run with cscript:
RunMeWithCScript()


'// Connect to the Windows Update COM object:
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
intHistoryCount = objSearcher.GetTotalHistoryCount

'// Get WU history data:
Set colHistory = objSearcher.QueryHistory(1, intHistoryCount)

'// Loop through and print to screen:
For Each objEntry in colHistory
WScript.Echo "=============================="
WScript.Echo objEntry.Title
WScript.Echo ""
WScript.Echo "Support URL: " & vbCrLf & objEntry.SupportURL
WScript.Echo ""
WScript.Echo "Description: " & vbCrLf & objEntry.Description
WScript.Echo ""
WScript.Echo "Installed On: " & vbCrLf & objEntry.Date
WScript.Echo ""
Select Case objEntry.ResultCode
Case 1 ResultCode = "Pending Reboot"
Case 2 ResultCode = "Successfully Installed"
Case 4 ResultCode = "Installation Failed"
Case 5 ResultCode = "Installation Canceled"
Case Else
ResultCode = "Unknown Installation Status"
End Select
WScript.Echo "Result code: " & vbCrLf & ResultCode
WScript.Echo ""
WScript.Echo "Client application ID: " & vbCrLf & objEntry.ClientApplicationID
i = 1
For Each strStep in objEntry.UninstallationSteps
WScript.Echo i & " -- " & strStep
i = i + 1
Next
If objEntry.UninstallationNotes = "" Then
' No uninstallation notes, print nothing
Else
WScript.Echo ""
WScript.Echo "Uninstallation notes: " & vbCrLf & objEntry.UninstallationNotes
End If
WScript.Echo "=============================="
WScript.Echo ""
WScript.Echo ""
Next


Sub RunMeWithCScript()
Dim ScriptEngine, engineFolder, Args, arg, scriptName, argString, scriptCommand

ScriptEngine = UCase(Mid(WScript.FullName, InstrRev(WScript.FullName, "\") + 1))
engineFolder = Left(WScript.FullName, InstrRev(WScript.FullName, "\"))
argString = ""

If ScriptEngine = "WSCRIPT.EXE" Then
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Set Args = WScript.Arguments

For Each arg in Args 'loop though argument array as a collection to rebuild argument string
If InStr(arg, " ") > 0 Then arg = """" & arg & """" 'If the argument contains a space wrap it in double quotes
argString = argString & " " & Arg
Next

'Create a persistent command prompt for the cscript output window and call the script with its original arguments
scriptCommand = "cmd.exe /k " & engineFolder & "cscript.exe """ & WScript.ScriptFullName & """" & argString

Shell.Run scriptCommand, , False
WScript.Quit
Else
Exit Sub 'Already Running with Cscript Exit this Subroutine
End If
End Sub

0

Share this post


Link to post
Share on other sites

Hmm, when I try to run your script (see above) then I get an error popup:

line 8

Char 1

The service cannot be started, either because it is disabled or because it has noenabled device associated with it

Code 80070422

I don't know which service or deviuce is meant.

How can I run this script otherwise or enable (which?) service?

Peter

0

Share this post


Link to post
Share on other sites

The script run without errors for me.

But I have to click ok for each line that is echoed.

how can I get it to print to a file?

0

Share this post


Link to post
Share on other sites

Hmm, when I try to run your script (see above) then I get an error popup:

line 8

Char 1

The service cannot be started, either because it is disabled or because it has noenabled device associated with it

Code 80070422

I don't know which service or deviuce is meant.

How can I run this script otherwise or enable (which?) service?

Peter

It's connecting to the Windows Update Service COM object. If you've disabled Windows Update or any of it's dependencies, this is the error you'll get. You can't enumerate updates that are tracked by the service if you've disabled it.

The script run without errors for me.

But I have to click ok for each line that is echoed.

how can I get it to print to a file?

Edit: Script updated to spawn itself via cscript in a cmd prompt, even if double-clicked.
0

Share this post


Link to post
Share on other sites

You could also:

go into control panel

Select small icons view

Select "Windows update" at the bottom

Then bottom left - see also - Installed updates

This will list all installed updates on the system.

0

Share this post


Link to post
Share on other sites

Sometimes, it helps to be able to have the data for analysis or for automation, though. The script (and other means) can be useful for that.

Edited by Glenn9999
0

Share this post


Link to post
Share on other sites

Not to mention if the user's disabled the WU service, The Windows Update panel won't show you an update history either until you enable it - it uses the same COM object for the WU window. Clicking "view history" when the service is disabled will just give you a blank screen with an OK button. ;)

0

Share this post


Link to post
Share on other sites

Decided to write one to also show updates that are applicable to a Win7 system but are not installed as well, because I ended up needing something like this last night:

'// Run with cscript:
RunMeWithCScript()


'// Connect to the Windows Update COM object:
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
Set colSearchResult = objSearcher.Search("IsInstalled=0")

'// Loop through and print to screen updates that are not drivers or language packs:
For I = 0 To colSearchResult.Updates.Count-1
isLanguagePack = False
Set update = colSearchResult.Updates.Item(I)
For Each Category In update.Categories
categoryID = Category.CategoryID
Next
If categoryID = "6d76a2a5-81fe-4829-b268-6eb307e40ef3" Then
'Language Pack, print nothing and move to next item
ElseIf update.Type = 2 Then
'Driver, print nothing and move to next item
Else
WScript.Echo "=============================="
WScript.Echo update.Title
WScript.Echo ""
WScript.Echo "Support URL: " & vbCrLf & update.SupportURL
WScript.Echo ""
For Each KB In update.KBArticleIDs
WScript.Echo "KB Article ID: " & vbCrLf & KB
Next
WScript.Echo ""
WScript.Echo "Update Description: " & vbCrLf & update.Description
x = 1
For Each strStep in update.UninstallationSteps
WScript.Echo x & " -- " & strStep
x = x + 1
Next
If update.UninstallationNotes = "" Then
' No uninstallation notes, print nothing
Else
WScript.Echo ""
WScript.Echo "Uninstallation notes: " & vbCrLf & update.UninstallationNotes
End If
WScript.Echo "=============================="
WScript.Echo ""
WScript.Echo ""
End If
Next


Sub RunMeWithCScript()
Dim ScriptEngine, engineFolder, Args, arg, scriptName, argString, scriptCommand

ScriptEngine = UCase(Mid(WScript.FullName, InstrRev(WScript.FullName, "\") + 1))
engineFolder = Left(WScript.FullName, InstrRev(WScript.FullName, "\"))
argString = ""

If ScriptEngine = "WSCRIPT.EXE" Then
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Set Args = WScript.Arguments

For Each arg in Args 'loop though argument array as a collection to rebuild argument string
If InStr(arg, " ") > 0 Then arg = """" & arg & """" 'If the argument contains a space wrap it in double quotes
argString = argString & " " & Arg
Next

'Create a persistent command prompt for the cscript output window and call the script with its original arguments
scriptCommand = "cmd.exe /k " & engineFolder & "cscript.exe """ & WScript.ScriptFullName & """" & argString

Shell.Run scriptCommand, , False
WScript.Quit
Else
Exit Sub 'Already Running with Cscript Exit this Subroutine
End If
End Sub

0

Share this post


Link to post
Share on other sites

Hi

Thanks for the ultimate tool to check un/installed updates.

Can we export the outcome of the script to a excel worksheet?

RK

0

Share this post


Link to post
Share on other sites

@cluberti:

Thank you for these easy & very useful VBScripts. The "not installed" script worked perfectly & showed the 9 updates I have chosen to hide.

The "installed" script only showed 11 results (attached), however in WU cpl I have the following:

4 "Hotfix"

42 "Security"

19 "Update"

IE 9

--------------

66 total

Win 7 Home Prem SP1 x64 on a Gateway NV59C Notebook, recently (about a week ago) clean installed to rid myself of the OEM bloat...if that makes any difference.

Edited by PinkFreud
0

Share this post


Link to post
Share on other sites

This is querying the same APIs that the inbox Windows Update uses, so assuming it's not showing everything that you've installed, the only thing that would make sense would be that you installed the patches manually (outside of WU). Otherwise, I'm not sure why this would be so. If you go to Windows Update and click the "view update history" link, does the output from my script match the output there? It should....

0

Share this post


Link to post
Share on other sites

Run this command from CMD:

WMIC WFE LIST FULL

You can export to HTML / CSV / TXT

Not need install anything.

0

Share this post


Link to post
Share on other sites

This is querying the same APIs that the inbox Windows Update uses...the only thing that would make sense would be that you installed the patches manually (outside of WU)...If you go to Windows Update and click the "view update history" link, does the output from my script match the output there? It should....

Thank you for your follow-up, it is much appreciated. In reply to the above:

1) All updates installed via WU except the 4 hotfixes mentioned-- all 4 show under Control Panel\All Control Panel Items\Windows Update--Installed Updates tab, 2 show under \View update history

2) It does not. (PNG's attached) Including Hotfixes, IE9, MSSE , MSRT there are 72 items listed under "History"--vs 66 under "Installed"

Just for the halibut, I re-ran the VBScript--same result. :(

:unsure::blink:

0

Share this post


Link to post
Share on other sites

I wrote this VBS script that makes a HTA that list the missing and installed updates.

I Gunsmokingman give all users full permission to do what ever they want with this script.

Save As KB_Report.vbs

'-> This code is property of Gunsmokingman and Or Jake1Eye and you must have his permission to use.'-> This is only posted as example code and meant only to used as such.'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Varibles And Objects For The ScriptDim Act, CName, CN, Fso, UpdateSession, UpdateSearcherSet Act = CreateObject("Wscript.Shell")Set Fso = CreateObject("Scripting.FileSystemObject")Set updateSession = CreateObject("Microsoft.Update.Session")Set updateSearcher = updateSession.CreateupdateSearcher()CName = Act.ExpandEnvironmentStrings("%ComputerName%")'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Ask If You Want To Use ScriptDim A1A1 = Act.Popup( _" Would You Like To Run The Report Updates Script?" & vbCrLf &_"The Script Will Take Approx 5 Minutes To Be Done." & vbCrLf &_"If Nothing Is Selected This Will Self Close In 7" & vbCrLf &_"Seconds And Do Nothing", 7, "Search Updates",4132)If A1 = 7 Or A1 = -1 ThenWScript.Quit(1)End If'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Varibles For The ScriptDim Arg1, Arg2, Arg3, C1, DT, Hta1, Hta2, Hta3, Hta4Dim Rpt, Str1, Str2, Str3, SearchResult, TS, Update, Var1, Var2, Var3'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Replace Any Spaces In The Computer NameIf InStr(CName," ") ThenCN = Replace(CName," ", "_")ElseCN = CNameEnd If'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Build The HtaDT = Act.SpecialFolders("Desktop")Rpt = (DT & "\" & CN & "_KbReport.hta")Rpt = Act.ExpandEnvironmentStrings("%UserProfile%\desktop\" & CN & "_KbReport.hta")Var1 = Chr(160) & Chr(171) & Chr(160)Var2 = Chr(160) & Chr(187) & Chr(160)Var3 = Var1 & "---------------------------------------" & Var2Set SearchResult = UpdateSearcher.Search("IsInstalled=0 and Type='Software'")Set TS = Fso.CreateTextFile(Rpt)TS.WriteLine "<TITLE>" & CName & "</TITLE>" & vbCrLf &_"<STYLE Type=""text/css"">" & vbCrLf &_" Body{Font-Size:9.25pt;Font-Weight:Bold;" & vbCrLf &_" Font-Family:segoeui,helvetica,verdana,arial,Poor Richard;" & vbCrLf &_" Color:#000063;BackGround-Color:Transparent;" & vbCrLf &_" Filter:progid:DXImageTransform.Microsoft.Gradient" & vbCrLf &_" (StartColorStr='#fdf7f1',endColorStr='#d1cbc5');" & vbCrLf &_" Margin-Top:5;Margin-Bottom:5;Margin-Left:4;Margin-Right:4;" & vbCrLf &_" Padding-Top:5;Padding-Bottom:5;Padding-Left:4;Padding-Right:4;" & vbCrLf &_" Text-Align:Left;Vertical-Align:Top;" & vbCrLf &_" Border-Top:2px Solid #cbc7c3;Border-Bottom:3px Solid #a6a29e;" & vbCrLf &_" Border-Left:2px Solid #bcb8b4;Border-Right:3px Solid #b2aeaa;}" & vbCrLf &_" Table.Table1{Font-Size:8.25pt;Color:Blue;Font-Weight:Bold;Width:395px;}" & vbCrLf &_" Div.D1{Font-Size:8.25pt;Color:#1e1e1e;Padding-Left:25;Width:97%;}" & vbCrLf &_" Font.F1{Color:#004400;Padding-Left:18;}" & vbCrLf &_" Font.F2{Font-Weight:Bold;Color:#000063;Padding-Left:23;}" & vbCrLf &_"</STYLE>" & vbCrLf &_"<script LANGUAGE='JScript'>window.resizeTo (675,395), window.moveTo (210,175);</SCRIPT>"TS.WriteLine "<BODY><CENTER><TABLE>" & Var1 & Now() & Var2 &_"</TABLE><TABLE>List Of Missing Updates</TABLE><HR Width=95%></CENTER>"For I = 0 To searchResult.Updates.Count-1C1 = C1 + 1If Len(C1) = 3 Then C1 = C1If Len(C1) = 2 Then C1 = "0" & C1If Len(C1) = 1 Then C1 = "00" & C1Set Update = SearchResult.Updates.Item(I)RptUpdate()Arg3 = Arg3 & vbCrLf & Update.TitleNext'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> If There Are No Updates To Install On The MachineIf SearchResult.Updates.Count = 0 ThenTS.WriteLine "<FONT Class='F1;'>" & Var1 & C1 & Var2 & "</FONT>" & vbCrLf &_"<FONT Class='F2'>There Are No Applicable Updates, To Install""</FONT>" & vbCrLf &_"<CENTER><HR Width=95%></CENTER>"End IfDim SResultsC1 = 0TS.WriteLine "<CENTER><TABLE>List Of Installed Updates</TABLE><HR Width=95%></CENTER>"Set SResults = UpdateSearcher.Search("IsInstalled=1 and Type='Software'")For I = 0 To SResults.Updates.Count-1C1 = C1 + 1If Len(C1) = 3 Then C1 = C1If Len(C1) = 2 Then C1 = "0" & C1If Len(C1) = 1 Then C1 = "00" & C1Set Update = SResults.Updates.Item(I)RptUpdate()Next'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Report The Update InformationFunction RptUpdate()TS.WriteLine "<FONT Class='F1;'>" & Var1 & C1 & Var2 & "</FONT>" & vbCrLf &_"<FONT Class='F2'>" & Update.Title & "</FONT>" & vbCrLf &_"<DIV Class='D1'>  " & Update.Description & "</DIV>" & vbCrLf &_"<CENTER><HR Width=95%></CENTER>"End FunctionTS.Close'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Run The HtaSet Arg1 = Fso.GetFile(Rpt)Act.Run("mshta.exe " & Chr(34) & Arg1.Path & Chr(34)),1,True'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/-> Keep Or Delete The Hta ReportIf MsgBox("Did You Want To Keep The HTA Update Report?" & vbCrLf & _"Yes To Keep The Hta, No To Delete The Hta.",4132,"Keep Or Delete") = 7 ThenFso.DeleteFile Arg1End If
0

Share this post


Link to post
Share on other sites

nice script!

Can you add the option to click the entries and to to the KB page?

0

Share this post


Link to post
Share on other sites

:w00t:

Script is not Windows 7 Specific... :)

0

Share this post


Link to post
Share on other sites

Can you add the option to click the entries and to to the KB page?

I have updated the script so it goes to the search results of the KB, this does not

wotk 100%. I have edit the script so it will try and get the Kb number then pass

that varible to microsoft.com/downloads/results and hope it list the information.

I Gunsmokingman give all users full permission to do what ever they want with this script.

Save As List_Kb.vbs

'-> This code is property of Gunsmokingman and Or Jake1Eye and you must have his permission to use.'-> This is only posted as example code and meant only to used as such.Option Explicit'-> Makes ShorterDim Vb :Vb = vbCrLf'-> Objects For Script Run TimeDim Act, Fso, CNameSet Act = CreateObject("Wscript.Shell")Set Fso = CreateObject("Scripting.FileSystemObject")CName = Act.ExpandEnvironmentStrings("%ComputerName%")'-> Ask If You Want To Use ScriptDim A1A1 = Act.Popup( _" Would You Like To Run The Report Updates Script?" & Vb & _"The Script Will Take Approx 5 Minutes To Be Done." & Vb & _"If Nothing Is Selected This Will Self Close In 7" & Vb & _"Seconds And Do Nothing", 7, "Search Updates",4132)If A1 = 7 Or A1 = -1 ThenWScript.Quit(1)End If'-> Varibles For Hta OutputDim Hta :Hta = Act.SpecialFolders("Desktop") & "\" & CName & "_KbInfo.hta"Dim Ar :Ar = Chr(160) & Chr(187) & Chr(160)Dim Al :Al = Chr(160) & Chr(171) & Chr(160)Dim Ts'-> Search Objects And VariblesDim SearchResult, Update, UpDateSearcher,UpDateSessionSet UpDateSession = CreateObject("Microsoft.Update.Session")Set UpDateSearcher = UpDateSession.CreateUpDateSearcher()Set SearchResult = UpDateSearcher.Search("Type='Software'")'-> Varibles For Count, Loop, UpdatesDim C1, I, Kb_C, Kb_M, M1, V1, V2 :C1=0 :M1=0'-> Loop To List Install And Missing UpdatesFor I = 0 To SearchResult.Updates.Count-1Set Update = SearchResult.Updates.Item(I)If Update.IsInstalled ThenC1 = C1 + 1 : V1 = C1Kb_C = Kb_C & C1 & "=-=" & Update.Title & "=-=" & Update.Description & VbElseM1 = M1 + 1 : V2 = M1Kb_M = Kb_M & M1 & "=-=" & Update.Title & "=-=" & Update.Description & VbEnd IfNext'-> If There Are No Missing UpdatesIf M1 = 0 ThenV2 = "000"Kb_M = "000=-=No Updates Found=-=There Was No Updates Missing" & VbEnd If'-> If There Are No Installed UpdatesIf C1 = 0 ThenV1 = "000"Kb_C = "000=-=No Updates Found Installed=-=There Was No Updates Found Installed." & VbEnd If'-> Add Zero For 3 DigitIf Len(V1) = 2 Then V1 = "0" & V1If Len(V1) = 1 Then V1 = "00" & V1If Len(V2) = 2 Then V2 = "0" & V2If Len(V2) = 1 Then V2 = "00" & V2'-> Build The Hta ReportSet TS = Fso.CreateTextFile(Hta)TS.WriteLine "<TITLE>" & CName & "</TITLE>" & Vb & _"<STYLE Type=""text/css"">" & Vb & _" Body{Font-Size:9.25pt;Font-Weight:Bold;" & Vb & _" Font-Family:segoeui,helvetica,verdana,arial,Poor Richard;" & Vb & _" Color:#000063;BackGround-Color:Transparent;" & Vb & _" Filter:progid:DXImageTransform.Microsoft.Gradient" & Vb & _" (StartColorStr='#fdf7f1',endColorStr='#d1cbc5');" & Vb & _" Margin-Top:5;Margin-Bottom:5;Margin-Left:4;Margin-Right:4;" & Vb & _" Padding-Top:5;Padding-Bottom:5;Padding-Left:4;Padding-Right:4;" & Vb & _" Text-Align:Left;Vertical-Align:Top;" & Vb & _" Border-Top:2px Solid #cbc7c3;Border-Bottom:3px Solid #a6a29e;" & Vb & _" Border-Left:2px Solid #bcb8b4;Border-Right:3px Solid #b2aeaa;}" & Vb & _" TD.Tx1{Font-Size:8.25pt;Color:#004747;Font-Weight:Bold;Padding-Left:3;Width:70pt;}" & Vb & _" TD.Tx2{Font-Size:8.25pt;Color:#006969;Font-Weight:Bold;Width:105pt;}" & Vb & _" P.D1{Font-Size:8.25pt;Color:#1e1e1e;Width:99%;Padding-Left:1;Margin:1pt;}" & Vb & _" FONT.F1{Font-Size:8.25pt;Color:#004400;Padding-Left:3;Width:17pt;}" & Vb & _" FONT.F2{Font-Size:8.25pt;Font-Weight:Bold;Color:#000063;Padding-Left:3;}" & Vb & _"</STYLE>" & Vb & _"<script LANGUAGE='JScript'>window.resizeTo (725,425), window.moveTo (210,175);</SCRIPT>"Ts.WriteLine "<BODY Link='#003535' vLink='#007575' aLink='#003535'>" & Vb & _"<TABLE ALIGN='CENTER'><TD CLASS='Tx1'>Scan Date Time</TD><TD CLASS='Tx2'>" & _Ar & Now & "</TD></TABLE>" & Vb & _"<TABLE ALIGN='CENTER'><TD CLASS='Tx1'>Computer Name</TD><TD CLASS='Tx2'>" & _Ar & CName & "</TD></TABLE>" & Vb & _"<TABLE ALIGN='CENTER'><TD CLASS='Tx1'>Install KB</TD><TD CLASS='Tx2'>" & _Ar & V1 & "</TD></TABLE>" & Vb & _"<TABLE ALIGN='CENTER'><TD CLASS='Tx1'>Missing KB</TD><TD CLASS='Tx2'>" & _Ar & V2 & "</TD></TABLE><HR Width=97%>"Ts.WriteLine "<TABLE Align='Center'>List Of Missing Updates</TABLE><HR Width=99%>"SortInfo(Kb_M)Ts.WriteLine "<TABLE Align='Center'>List Of Installed Updates</TABLE><HR Width=99%>"SortInfo(Kb_C)Ts.Close'-> Run The HtaAct.Run("mshta.exe " & Chr(34) & Hta & Chr(34)),1,True'/-> Keep Or Delete The Hta ReportIf MsgBox("Did You Want To Keep The HTA Update Report?" & Vb & _"Yes To Keep The Hta, No To Delete The Hta.",4132,"Keep Or Delete") = 7 ThenFso.DeleteFile Hta, TrueEnd If'-> Function Sort The Info For Display In The HtaFunction SortInfo(Arg)Dim Obj, S1, VFor Each Obj In Split(Arg,Vb)If Not Obj = "" ThenV = Split(Obj,"=-=")S1= Right(V(1),11)If Len(V(0)) = 2 Then V(0) = "0" & V(0)If Len(V(0)) = 1 Then V(0) = "00" & V(0)If InStr(S1,"(") Then S1 = Replace(S1,"(","")If InStr(S1,")") Then S1 = Replace(S1,")","")If InStr(S1,"-") Then S1 = Replace(S1,"-","")If InStr(S1," ") Then S1 = Replace(S1," ","")'-> Sort The Info For Links And None linksIf LCase(Left(S1,2)) = "kb" ThenTs.WriteLine "<FONT Class='F1'>" & Al & V(0) & Ar & "</FONT>" & Vb & _"<FONT Class='F2'>" & V(1) & "</FONT>" & Vb &_"<P Class='D1'>  " & V(2) & "</DIV>" & Vb & _"<DIV ALIGN='CENTER'>" & Vb & _"<A HREF='http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=" & _S1 &"&DisplayLang='>" & S1 & " Information</A></DIV><HR Width=99%>" & Vb & VbElseTs.WriteLine "<FONT Class='F1'>" & Al & V(0) & Ar & "</FONT>" & Vb &_"<FONT Class='F2'>" & V(1) & "</FONT>" & Vb &_"<P Class='D1'>  " & V(2) & "</DIV><HR Width=99%>" & Vb & VbEnd IfEnd IfNextEnd Function
0

Share this post


Link to post
Share on other sites

Nice script. :thumbup

Good news/ Bad news...

The Good: Results seem accurate at first glance :)

The Bad (IMHO, YMMV): Opens Bing results in Innernetz Ex-PLODE-r :angry:

Edited by PinkFreud
0

Share this post


Link to post
Share on other sites

This is what I get when I selected a radom link from my computer, with IE as my browser on win7 x64

post-5386-0-89360100-1338338605_thumb.pn

0

Share this post


Link to post
Share on other sites

This is what I get when I selected a radom link from my computer, with IE as my browser on win7 x64

>>>blushes<<< I stand corrected, I haven't used IE for years and have NEVER used IE 9 for ANY browsing (used IE 10 a little in 8 Cons Prev) Ididn't recognize the advanced results from MSDLC

Here's what I'm used to in FF & Chrome (KB specific):

Edited by PinkFreud
0

Share this post


Link to post
Share on other sites

I made this HTA that does the same as the VBS script.

I Gunsmokingman give all users full permission to do what ever they want with this script.

Save As Kb_List.hta

post-5386-0-25423200-1338360060_thumb.pn

<!-- Hta And Script By Gunsmokingman Aka Jake1Eye This code is property of Gunsmokingman and Or Jake1Eye and you must have his permission to use. This is only posted as example code and meant only to used as such.--><TITLE>List Install Updates</TITLE><HTA:APPLICATION ID="KbInfo"SCROLL="No"SCROLLFLAT ="No"SingleInstance="Yes"ShowInTaskbar="Yes"SysMenu="No"MaximizeButton="No"MinimizeButton="No"Border="Thin"BORDERSTYLE ="complex"INNERBORDER ="No"Caption="Yes"WindowState="Normal"APPLICATIONNAME="InfoKb"Icon="%SystemRoot%\explorer.exe"><STYLE Type='text/css'>Body{Font-Size:9.25pt;Font-Weight:Bold;Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;Color:Black;BackGround-Color:#EFE9E3;Margin-Top:21;Margin-Bottom:1;Margin-Left:4;Margin-Right:4;Padding-Top:1;Padding-Bottom:1;Padding-Left:4;Padding-Right:4;Text-Align:Left;Vertical-Align:Top;Border-Top:0px Transparent;Border-Bottom:0px Transparent;Border-Left:0px Transparent;Border-Right:0px Transparent;}DIV{Font-Size:8.25pt;Font-Weight:Bold;Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MSColor:Black;#635D57;Text-Align:Left;Filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#ece6e0',EndColorStr='#c0bab4');Padding:3pt;}TD{Font-Size:8.25pt;Font-Weight:Bold;Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MSColor:Black;#635D57;Text-Align:Center;Filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#ece6e0',EndColorStr='#c0bab4');}TD.A1{Cursor:Hand;Color:#224747;Text-Align:Center;Filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr='AliceBlue',endColorStr='LightSlateGray');}TD.A2{Cursor:Hand;Color:#113535;Text-Align:Center;Filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr='AliceBlue',endColorStr='SeaGreen');}Select{Font-Size:7.25pt;Font-Weight:Bold;Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS}</STYLE><script LANGUAGE='JScript'>//-> Resize And Place In Approx centervar W = 725, H = 275;window.resizeTo(W,H)window.moveTo(screen.availWidth/2-(W/2),screen.availHeight/2-(H/2))</SCRIPT><script Language="VBScript">Dim Kb_Info_Var, Kb_Name_Var, Kb_SelectDim Ar :Ar = Chr(160) & Chr(187) & Chr(160)Function FindKb()If Kb_C.options.length = 0 Then QuerryKb(1)If Kb_M.options.length = 0 Then QuerryKb(0)Exit FunctionEnd Function'-> Add To The Select option Update Name And InfoFunction QuerryKb(N)Dim objOptionDim C1 :C1 = 0Set updateSession = CreateObject("Microsoft.Update.Session")Set updateSearcher = updateSession.CreateupdateSearcher()Set SearchResult = UpdateSearcher.Search("IsInstalled=" & N & " and Type='Software'")For I = 0 To searchResult.Updates.Count-1C1 = C1 + 1Set Update = SearchResult.Updates.Item(I)Set objOption = Document.createElement("OPTION")If C1 Mod 2 ThenobjOption.Text = Update.TitleobjOption.Value = Update.DescriptionobjOption.style.color = "Blue"objOption.style.background= "#ECE6E1"ElseobjOption.Text = Update.TitleobjOption.Value = Update.DescriptionobjOption.style.color = "Green"objOption.style.background= "#FBF5F0"End IfIf N = 1 Then Kb_C.Add(objOption)If N = 0 Then Kb_M.Add(objOption)NextIf N = 1 And SearchResult.Updates.Count = 0 ThenSet objOption = Document.createElement("OPTION")objOption.Text = "No Update Found Installed"objOption.Value = "No Update Information. Please Run Windows Update"objOption.style.color = "Blue"objOption.style.background= "#ECE6E1"Kb_C.Add(objOption)End IfIf N = 0 And SearchResult.Updates.Count = 0 ThenSet objOption = Document.createElement("OPTION")objOption.Text = "No Update Are Needed"objOption.Value = "No Update Missing. All Windows Updates Installed"objOption.style.color = "Blue"objOption.style.background= "#ECE6E1"Kb_C.Add(objOption)End IfIf Len(C1) = 2 Then C1 = "0" & C1If Len(C1) = 1 Then C1 = "00" & C1If N = 1 Then Tx1.innerHTML = "Install Updates :" & Ar & C1If N = 0 Then Tx2.innerHTML = "Missing Updates :" & Ar & C1Exit FunctionEnd Function'-> Confirm Update Select OptionFunction SelectConfirm()If Kb_C.options.length => 1 ThenOn Error Resume NextFor i = 0 To Kb_C.options.lengthIf Kb_C.options(i).selected ThenKb_Select = 1Kb_Info_Var = Kb_C.options(i).valueKb_Name_Var = Kb_C.options(i).textKb_Name.style.visibility = ""Kb_Name.innerHTML = Kb_Name_VarKb_Info.style.visibility = ""Kb_Info.innerHTML = Kb_Info_VarEnd IfNextEnd IfExit FunctionEnd Function'-> Missing Update Select OptionFunction SelectMissing()If Kb_M.options.length => 1 ThenOn Error Resume NextFor i = 0 To Kb_M.options.lengthIf Kb_M.options(i).selected ThenKb_Select = 2Kb_Info_Var = Kb_M.options(i).valueKb_Name_Var = Kb_M.options(i).textKb_Name.style.visibility = ""Kb_Name.innerHTML = Kb_Name_VarKb_Info.style.visibility = ""Kb_Info.innerHTML = Kb_Info_VarEnd IfNextEnd IfExit FunctionEnd Function'-> Process Select Item To Open New WindowFunction ProcessSearchQuerry()If Kb_C.options.length = 0 Or Kb_M.options.length = 0 Thenalert("Please Run The Process KB Querry Button First. Then" & vbCrlf & _"Select An Update From The List That You, Want" & vbCrlf & _"To Find Some More Information Or Download." )ElseIf Kb_Name_Var = "" Thenalert("Please Select An Item From The Select Options" )ElseIf Kb_Select = 1 Then S1 = Right(Kb_Name_Var,11)If Kb_Select = 2 Then S1 = Right(Kb_Name_Var,11)If InStr(S1,"(") Then S1 = Replace(S1,"(","")If InStr(S1,")") Then S1 = Replace(S1,")","")If InStr(S1,"-") Then S1 = Replace(S1,"-","")If InStr(S1," ") Then S1 = Replace(S1," ","")If LCase(Left(S1,2)) = "kb" Thenwindow.open( _"http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=" & _S1 &"&DisplayLang=")Elsealert("Can Not Process This Update Link")End IfEnd IfExit FunctionEnd Function</SCRIPT><BODY Style='Align:Center;'><TABLE Align='Center' Border='1'><TD ID='Tx1' Class='A1' style="width:223pt;">Install Updates</TD><TD ID='Tx2' Class='A1' style="width:223pt;">Missing Updates</TD></TABLE><TABLE Align='Center' Border='1'><TD><Select size="1" ID='Kb_C' name='Kb_C' OnChange="SelectConfirm()" style="width:225pt;"></Select></TD><TD><Select size="1" ID='Kb_M' name='Kb_M' OnChange="SelectMissing()" style="width:225pt;"></Select></TD></TABLE><!-- Display KB Name --><DIV ID='Kb_Name' Style='position:absolute;Bottom:85pt;Left:42pt;Width:446pt;Height:16pt;visibility:hidden;'></DIV><!-- Display KB Information --><DIV ID='Kb_Info' Style='position:absolute;Bottom:36pt;Left:42pt;Width:446pt;Height:48pt;visibility:hidden;'></DIV><!-- Button Container --><TABLE Border='1' Style='position:absolute;Bottom:16pt;Left:73pt;'><TD Class='A1' OnMouseOver="this.className='A2'"OnMouseOut="this.className='A1'" OnClick='FindKb()'style="width:123pt;Height:19;">Process KB Querry</TD><TD Class='A1' OnMouseOver="this.className='A2'"OnMouseOut="this.className='A1'" OnClick='ProcessSearchQuerry()'style="width:123pt;Height:19;">Open Application</TD><TD Class='A1' OnMouseOver="this.className='A2'"OnMouseOut="this.className='A1'" OnClick='window.close()'style="width:123pt;Height:19;">Close Application</TD></TABLE></BODY>
0

Share this post


Link to post
Share on other sites

the script works fine. Well done! good job :thumbup

0

Share this post


Link to post
Share on other sites

I hate to hijack, but the posts in this thread is something I'm trying to figure out. I haven't the foggiest about VBS scripts. Can someone code me a vbs that creates a semicolon delimited txt file that lists installed and not installed KB#'s and the ProductID#'s (the one that looks like a GUID). Wish list... if there is a way to get superseded updates, maybe add another semicolon with the word superseded on the same line? Wish list part 2.... it would be cool if there's also a semicolon delimited direct download link to the msu file too.

Here's an example of the desired output.

2667402;bfe5b177-a086-47a0-b102-097e4fa1f807

TIA!

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.