Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Quiet installation of patches in windows system

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Purpose: you can automatically install system patches in batches.

Environment: window 7

The script is as follows:

@ echo Off title Install Windows Update pack echo is being installed. Please wait a moment. :: loop all exe files in the current directory and install for% I in (* .exe) do% I / passive / norestart / nobackup:: loop all msu in the current directory, and install for% f in (* .msu) do start / wait wusa% f / quiet / norestart

Understand:

Mainly, the for loop returns the parameters of the current directory and then executes. Here / quiet does not ask mode, / norestart does not restart. For patch files, this script was originally used to install patches quietly, and / passive is executed sequentially. , / nobackup is not backed up.

If you need to restart automatically after installing all the patches, you can add shutdown-r-t 20 at the end

If you are worried about going wrong, here is a safe way to do it:

1) put the patch files in the same directory

2) navigate to this directory in cmd and execute dir / b > a.txt

3) A list of all the files in the current directory will be generated in the a.txt file. Select a file name from each type and use /? in the cmd. Query its parameters, and then write the required parameters to the end of the corresponding file in the list

4) delete the a.txt line in the list and change the a.txt file name to a.bat execution.

This method is slow, but proper (pay attention to the spaces in each position).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report