none
Need some help in scripting RRS feed

  • General discussion

  • Hi

    I have list of microsoft updates which i need to install, while installing 
    i need to check whether the update is already installed or not. If it is already installed i need to continue to check for next updates.

    Below is my sample script:

    for /f %%A in ('dir /b *.exe') do (
    >> %log% 2>&1 echo == installing updates == "%%A"...
    >> %log% 2>&1 wmic qfe | findstr /i "%%A"
    >> %log% 2>&1 "%%A" /passive /norestart
    )

    Can anyone help me in this issue?

    Best Regards

    • Changed type Bill_Stewart Friday, July 27, 2018 4:28 PM
    • Moved by Bill_Stewart Friday, July 27, 2018 4:28 PM Unanswerable drive-by question
    Tuesday, April 17, 2018 1:34 PM

All replies

  • Why write a script? Use WSUS to distribute and report on updates.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, April 17, 2018 2:13 PM
  • Thanks for your reply.... but i have a requirement to do it in scripting only i cannot use any other things.

    So can anyone help me out?

    Best Regards,

    Thursday, April 19, 2018 9:06 AM
  • Use PowerShell.  Batch is obsolete.

    Get-ChildItem *.exe |
        ForEach-Object{
            Start-Process $_.Fullname -ArgumentList '/passive /norestart'
        }

    If update is already installed the update will be skipped automatically.


    \_(ツ)_/


    • Edited by jrv Thursday, April 19, 2018 9:15 AM
    Thursday, April 19, 2018 9:14 AM
  • Currently i cannot use PowerShell that's why am asking.

    My requirement is to do it only in batch script.

    Best Regards,

    Thursday, April 19, 2018 11:50 AM
  • Currently i cannot use PowerShell

    Sure you can. What's stopping you?


    -- Bill Stewart [Bill_Stewart]

    Thursday, April 19, 2018 3:20 PM
  • Currently i cannot use PowerShell that's why am asking.

    My requirement is to do it only in batch script.

    Best Regards,

    There is no current training class or company that should be requiring batch. "batch" is not a scripting language but is a batch command language with minimal support for conditional logic and no access to the Windows API or base system.  It is an obsolete system.

    There is also no need to check manually for installed updates.  If the update has already been installed the installation will not happen.  Just define a log file for the install and all will be recorded.


    \_(ツ)_/

    Thursday, April 19, 2018 4:27 PM