MSFN Forum: How to list all currently installed Win7 patches/updates? - MSFN Forum

Jump to content


Windows 7 forum rules

If you have questions about customizing Windows 7 that are vLite-specific, please post them in the vLite forum, not here. If you have questions regarding the unattended installation of Windows 7, please post them in the Unattended Windows 7/Server 2008 R2 section.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

How to list all currently installed Win7 patches/updates?

#1 User is offline   msoff20xx 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 06-October 10
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2010 - 10:45 AM

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


#2 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 18 October 2010 - 03:03 PM

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


#3 User is offline   msoff20xx 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 06-October 10
  • OS:none specified
  • Country: Country Flag

Posted 21 October 2010 - 02:06 AM

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

#4 User is offline   jbm 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 635
  • Joined: 16-September 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 21 October 2010 - 02:48 AM

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?

#5 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 21 October 2010 - 07:09 AM

View Postmsoff20xx, on 21 October 2010 - 02:06 AM, said:

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.


View Postjbm, on 21 October 2010 - 02:48 AM, said:

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.

#6 User is offline   maxvre 

  • Group: Members
  • Posts: 7
  • Joined: 02-March 09

Posted 21 October 2010 - 03:59 PM

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.

#7 User is offline   Glenn9999 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 628
  • Joined: 23-April 07

Posted 21 October 2010 - 04:54 PM

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.

This post has been edited by Glenn9999: 21 October 2010 - 04:59 PM


#8 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 21 October 2010 - 05:15 PM

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. ;)

#9 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 28 October 2010 - 08:52 AM

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


#10 User is offline   rahulwithu 

  • Group: Members
  • Posts: 1
  • Joined: 26-May 12
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 May 2012 - 04:18 PM

Hi

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

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

RK

#11 User is offline   PinkFreud 

  • Junior
  • Pip
  • Group: Members
  • Posts: 52
  • Joined: 12-August 10
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 May 2012 - 10:38 PM

@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.


This post has been edited by PinkFreud: 26 May 2012 - 10:43 PM


#12 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 28 May 2012 - 09:37 AM

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....

#13 User is offline   stenio 

  • Group: Members
  • Posts: 1
  • Joined: 20-July 11
  • OS:none specified
  • Country: Country Flag

Posted 28 May 2012 - 09:56 AM

Run this command from CMD:

WMIC WFE LIST FULL

You can export to HTML / CSV / TXT

Not need install anything.

#14 User is offline   PinkFreud 

  • Junior
  • Pip
  • Group: Members
  • Posts: 52
  • Joined: 12-August 10
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 28 May 2012 - 10:58 AM

View Postcluberti, on 28 May 2012 - 09:37 AM, said:

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:



#15 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 28 May 2012 - 11:46 AM

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

Save As KB_Report.vbs
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Varibles And Objects For The Script
Dim Act, CName, CN, Fso, UpdateSession, UpdateSearcher
 Set 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 Script
 Dim A1 
  A1 = 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 Then
   WScript.Quit(1)
 End If 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Varibles For The Script        
Dim Arg1, Arg2, Arg3, C1, DT, Hta1, Hta2, Hta3, Hta4
Dim Rpt, Str1, Str2, Str3, SearchResult, TS, Update, Var1, Var2, Var3
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Replace Any Spaces In The Computer Name
 If InStr(CName," ") Then 
  CN = Replace(CName," ", "_")
 Else 
  CN = CName 
 End If 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Build The Hta
DT = 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 & "---------------------------------------" & Var2
  Set 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-1
   C1 = C1 + 1
   If Len(C1) = 3 Then C1 = C1
   If Len(C1) = 2 Then C1 = "0" & C1
   If Len(C1) = 1 Then C1 = "00" & C1
   Set Update = SearchResult.Updates.Item(I)
    RptUpdate()
    Arg3 = Arg3 & vbCrLf & Update.Title
  Next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> If There Are No Updates To Install On The Machine
  If SearchResult.Updates.Count = 0 Then
  TS.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 If 
Dim SResults
  C1 = 0 
  TS.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-1
   C1 = C1 + 1
   If Len(C1) = 3 Then C1 = C1
   If Len(C1) = 2 Then C1 = "0" & C1
   If Len(C1) = 1 Then C1 = "00" & C1
   Set Update = SResults.Updates.Item(I)
    RptUpdate()
  Next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Report The Update Information
  Function 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 Function 
  TS.Close
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Run The Hta
 Set Arg1 = Fso.GetFile(Rpt) 
  Act.Run("mshta.exe " & Chr(34) & Arg1.Path & Chr(34)),1,True
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'/-> Keep Or Delete The Hta Report
  If 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 Then
   Fso.DeleteFile Arg1
  End If 



Rename KB_Report.vbs.txt to KB_Report.vbs to make active

Attached File(s)



#16 User is offline   MagicAndre1981 

  • after Windows 7 GA still Vista lover :)
  • Group: Patrons
  • Posts: 4,976
  • Joined: 28-August 05
  • OS:Vista Ultimate x86
  • Country: Country Flag

Posted 29 May 2012 - 07:52 AM

nice script!

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

#17 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,247
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 29 May 2012 - 08:35 AM

:w00t:
Script is not Windows 7 Specific... :)

#18 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 29 May 2012 - 05:50 PM

Quote

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.

Save As List_Kb.vbs
Option Explicit
'-> Makes Shorter
Dim Vb :Vb = vbCrLf
'-> Objects For Script Run Time
Dim Act, Fso, CName
 Set Act = CreateObject("Wscript.Shell")
 Set Fso = CreateObject("Scripting.FileSystemObject")
 CName = Act.ExpandEnvironmentStrings("%ComputerName%")
'-> Ask If You Want To Use Script
 Dim A1 
  A1 = 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 Then
   WScript.Quit(1)
 End If 
'-> Varibles For Hta Output
Dim 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 Varibles
Dim SearchResult, Update, UpDateSearcher,UpDateSession
 Set UpDateSession = CreateObject("Microsoft.Update.Session")
 Set UpDateSearcher = UpDateSession.CreateUpDateSearcher()
 Set SearchResult = UpDateSearcher.Search("Type='Software'")
'-> Varibles For Count, Loop, Updates  
Dim C1, I, Kb_C, Kb_M, M1, V1, V2 :C1=0 :M1=0 
'-> Loop To List Install And Missing Updates
  For I = 0 To SearchResult.Updates.Count-1
  Set Update = SearchResult.Updates.Item(I)
   If Update.IsInstalled Then
    C1 = C1 + 1 : V1 = C1
    Kb_C = Kb_C & C1 & "=-=" & Update.Title & "=-=" & Update.Description & Vb 
   Else
    M1 = M1 + 1 : V2 = M1
    Kb_M = Kb_M & M1 & "=-=" & Update.Title & "=-=" & Update.Description & Vb 
   End If
  Next
'-> If There Are No Missing Updates
  If M1 = 0 Then
   V2 = "000"
   Kb_M = "000=-=No Updates Found=-=There Was No Updates Missing" & Vb
  End If
'-> If There Are No Installed Updates
  If C1 = 0 Then 
   V1 = "000"
   Kb_C = "000=-=No Updates Found Installed=-=There Was No Updates Found Installed." & Vb
  End If
'-> Add Zero For 3 Digit
   If Len(V1) = 2 Then V1 = "0" & V1
   If Len(V1) = 1 Then V1 = "00" & V1
   If Len(V2) = 2 Then V2 = "0" & V2
   If Len(V2) = 1 Then V2 = "00" & V2
'-> Build The Hta Report
  Set 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 Hta
  Act.Run("mshta.exe " & Chr(34) & Hta & Chr(34)),1,True
'/-> Keep Or Delete The Hta Report
  If 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 Then
   Fso.DeleteFile Hta, True 
  End If
'-> Function Sort The Info For Display In The Hta
  Function SortInfo(Arg)
  Dim Obj, S1, V
   For Each Obj In Split(Arg,Vb)
    If Not Obj = "" Then
     V = 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 links
     If LCase(Left(S1,2)) = "kb" Then
     Ts.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 & Vb 
     Else 
     Ts.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 & Vb 
     End If 
    End If 
   Next 
  End Function 



Rename List_Kb.vbs.txt to List_Kb.vbs to make active

Attached File(s)



#19 User is offline   PinkFreud 

  • Junior
  • Pip
  • Group: Members
  • Posts: 52
  • Joined: 12-August 10
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 29 May 2012 - 06:10 PM

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:

This post has been edited by PinkFreud: 29 May 2012 - 06:12 PM


#20 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 29 May 2012 - 06:44 PM

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

Attached File(s)



Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy