_
_
_ Disciple2019-09-26 09:47:02
cmd/bat
_ Disciple, 2019-09-26 09:47:02

How to make a bat file to install Office or Windows update files?

Good afternoon.
There was a problem displaying charts in Excel. Office 2016 18 Update does not recognize charts created in Office 2016 9/19 Update. The problem is solved by installing updates: 57 pcs. I'm tired of putting it manually. The server does not pull up automatically. There was an idea to write a bat file, launching which will install all the updates in the folder. At the same time, the computers are in the corp network and each time you need to enter the login and password of the administrator. It would be very nice to do the following:
Run the bat file. In the window, we enter the login and password of the administrator on demand, then the update files are installed with the status output for each installation (file name: successful or not) and the subsequent recording in the txt file of the final information, what was successfully installed and what was not. Please help me to implement this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2019-09-26
@aafrimenaa

You need to run the batch file from under the admin, then the programs launched from it will inherit the rights of the batch file.
In a batch file, or just run each update separately or in a loop like this:

@echo off
for %%a in (.exe) do (
   %%a <параметры>
)

The cycle option may not work, because Perhaps the order of the updates being installed is important. In this case, either the first option or you can make a text file in which you list the executable update files in the right order. Then the batch file will read the file line by line and run the program specified in the read line:
@echo off
for /f "tokens=* delims=" %%a in (updatelist.txt) do (
   "%%a" <параметры>
)

Update executables usually support some command line options. The list of options can be found by running the update with the /? . In your case, the "silent" installation option will be useful.
To help:
for /?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question