Using CMD script and VBScript to control Windows Update  

Page 4 of 7 FirstFirst ... 23456 ... LastLast
  1. Paul Black's Avatar
    Posts : 12,150
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #30

    Hello @Homer712,

    Homer712 said:
    . . . would it be possible to have the file being generated be dated. I'd like to keep copies over time so as to be able to compare them.

    [1] Are you talking about the installed WU's?
    [2] If so, you could run the following Command in a CMD Prompt . . .

    Code:
    
    PowerShell Get-Hotfix ^| Select HotFixID, Description, Source, InstalledOn ^| Sort-Object -Property InstalledOn ^| Format-Table -AutoSize

    You can obviously output the file generated to keep the data. Something like . . .

    Code:
    
    PowerShell Get-Hotfix ^| Select HotFixID, Description, Source, InstalledOn ^| Sort-Object -Property InstalledOn ^| Format-Table -AutoSize > "%UserProfile%\Desktop\WIn_Update.log"

    If you have a Relocated Desktop, then obviously CHANGE the output path to suit.
    The above will output a file named WIn_Update.log on your Desktop.

    I hope this helps.
      My Computer

  2. Homer712's Avatar
    Posts : 129
    Windows 10, 1909 (OS Build 18363.1379 )
       #31

    @Paul Black, Hello again and thanks. But the more I played with the one created by Matthew, it includes dates in the log itself. So saving "dated" ones would really be of no additional benefit.

    Using CMD script and VBScript to control Windows Update-image_93.png
      My Computer

  3. Matthew Wai's Avatar
    Posts : 5,006
    Windows 10 Home 20H2
    Thread Starter
       #32

    The creation date and time of the generated file can be retrieved.
    @Homer712, do you mean adding the date and time to the name of the file?

    This is an example: Batch files for use in BSOD debugging
      My Computer

  4. Homer712's Avatar
    Posts : 129
    Windows 10, 1909 (OS Build 18363.1379 )
       #33

    Matthew, yes, that was my original thought. So rather than "Installed updates.log" it was "Installed updates 3_29_21.log", or something along those lines.But as I said above, with the actual update dates being in the file proper, probably not needed.
      My Computer

  5. Matthew Wai's Avatar
    Posts : 5,006
    Windows 10 Home 20H2
    Thread Starter
       #34

    Homer712 said:
    Matthew, now I have "one last request", which is different from my "one last question."
    On TenForums, there are no such things as "one last request" and "one last question". All members here are eager to help each others.
      My Computer

  6. Homer712's Avatar
    Posts : 129
    Windows 10, 1909 (OS Build 18363.1379 )
       #35

    Matthew Wai said:
    On TenForums, there are no such things as "one last request" and "one last question". All members here are eager to help each others.
    I have been told that I can ask questions to the point of being annoying!

    Matthew, there is something that doesn't seem right, or possibly I just don't understand. In the cmd code posted by @Paul Black the hot fixes get listed by install date, from earliest to latest. In the getWindowsUpdateList.bat the Security Intelligence Updates get listed also by install date, from earliest to latest, but the hot fixes seem to be sorted by the hot fix ID for some, and by install date for others. Possibly there is a rational for that that I'm just not seeing.
      My Computer

  7. Matthew Wai's Avatar
    Posts : 5,006
    Windows 10 Home 20H2
    Thread Starter
       #36

    Homer712 said:
    Matthew, there is something that doesn't seem right, or possibly I just don't understand.
    I don't understand either.
    Get-Hotfix seems to sort the items as per description.
    Get-Hotfix|Sort-Object -Property InstalledOn does not sort anything.
    Code:
    PS C:\Users\Matthew_Wai> Get-Hotfix
    
    Source        Description      HotFixID      InstalledBy          InstalledOn
    ------        -----------      --------      -----------          -----------
    DESKTOP       Update           KB4576478                          9/27/2020 12:00:00 AM
    DESKTOP       Update           KB4562830                          9/27/2020 12:00:00 AM
    DESKTOP       Security Update  KB4570334                          9/27/2020 12:00:00 AM
    DESKTOP       Security Update  KB4577266                          9/27/2020 12:00:00 AM
    DESKTOP       Security Update  KB4598242     DESKTOP\Matthew_Wai  1/16/2021 12:00:00 AM
    
    
    PS C:\Users\Matthew_Wai> Get-Hotfix|Sort-Object -Property InstalledOn
    
    Source        Description      HotFixID      InstalledBy          InstalledOn
    ------        -----------      --------      -----------          -----------
    DESKTOP       Security Update  KB4570334                          9/27/2020 12:00:00 AM
    DESKTOP       Security Update  KB4577266                          9/27/2020 12:00:00 AM
    DESKTOP       Update           KB4576478                          9/27/2020 12:00:00 AM
    DESKTOP       Update           KB4562830                          9/27/2020 12:00:00 AM
    DESKTOP       Security Update  KB4598242     DESKTOP\Matthew_Wai  1/16/2021 12:00:00 AM

    Homer712 said:
    I have been told that I can ask questions to the point of being annoying!
    Feel free to go beyond that point.
      My Computer

  8. Paul Black's Avatar
    Posts : 12,150
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #37

    Very strange!

    Does this work? . . .

    Code:
    
    PowerShell Get-Hotfix ^| Select HotFixID, Description, Source, InstalledOn ^| Sort-Object -Property InstalledOn, HotFixID ^| Format-Table -AutoSize > "%UserProfile%\Desktop\WIn_Update.log"
      My Computer

  9. Matthew Wai's Avatar
    Posts : 5,006
    Windows 10 Home 20H2
    Thread Starter
       #38

    Paul Black said:
    Code:
    
    PowerShell Get-Hotfix ^| Select HotFixID, Description, Source, InstalledOn ^| Sort-Object -Property InstalledOn, HotFixID ^| Format-Table -AutoSize > "%UserProfile%\Desktop\WIn_Update.log"
    Code:
    HotFixID  Description     Source InstalledOn          
    --------  -----------     ------ -----------          
    KB4562830 Update                 9/27/2020 12:00:00 AM
    KB4570334 Security Update        9/27/2020 12:00:00 AM
    KB4576478 Update                 9/27/2020 12:00:00 AM
    KB4577266 Security Update        9/27/2020 12:00:00 AM
    KB4598242 Security Update        1/16/2021 12:00:00 AM
      My Computer

  10. Homer712's Avatar
    Posts : 129
    Windows 10, 1909 (OS Build 18363.1379 )
       #39

    @Paul Black The script you posted does in fact sort by date, which I think would be the desired output.
    Using CMD script and VBScript to control Windows Update-image_95.png

    @Matthew Wai Your original script sorts by the KB#, all except for the very first entry. Strange indeed.
    Using CMD script and VBScript to control Windows Update-image_94.png

    And I need to figure out how you guys post those expandable windows.
      My Computer


 
Page 4 of 7 FirstFirst ... 23456 ... LastLast

Tutorial Categories

Using CMD script and VBScript to control Windows Update Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 21:57.
Find Us




Windows 10 Forums