Fully Automatic Windows Update

I am working on a project whose goal is to be able to upgrade my Windows computer 100%. This means that a program or script automatically updates windows without any user interaction. Ideally, a stand-alone script that can be run from another script.

Reason: I need to upgrade a lot of computers in my work. They can be at any level of the patch, and everything from Windows XP to Windows 8. My goal is to run a script, wait / do something else, and then find a fully fixed computer.

I solved a lot by finding ZTIWindowsUpdate.wsf in MDT Task Sequence .

This can be used like this from admin cmd:

cssript.exe ZTIWindowsUpdate.wsf 

My problem is that the computer needs to restart some updates. Probably due to dependencies. ZTIWindowsUpdate.wsf should start as an administrator, and I cannot find a solution to start it when the administrator reboots. Also, if I run a script to run at startup, how do I stop it, and how do I know when to stop it?

Can someone help a doctor with a reliable solution to this problem?

Thanks!

+6
source share
6 answers

The easiest solution to the problem you are describing is to configure the script to automatically log in to the built-in administrator account, and then add yourself to the startup folder. To use this option, you need to know (or reset) the password for the administrator account.

There are many other possibilities, some examples: use the start script and psexec; use srvany to create a service that runs your script; use the task scheduler to schedule your script to run automatically, interactively or non-interactively; disable WUA, configure automatic login for the account you are using and add the script to the Startup folder.

Note that you will save time and bandwidth if you can configure a WSUS server or (even simpler and cheaper if you do not already have a Windows server) a transparent proxy server. However, this will not prevent a reboot during the update sequence.

You can find my script as an alternative starting point for ZTIWindowsUpdate.wsf, if only because it is smaller and easier to understand.

+2
source

You do NOT need a FULL Windows update, most updates are not required, most updates are not security related, and we can survive without them, you need to read the description of each update to understand what changes have been made, FULLY updating Windows can be a negative performance point in several scenarios.

All you need to do is download the updates you need and then save them in the folder with this package script:

 @Echo off For %%# in (*.msu) Do ( Echo: Installing update: %%# Wusa "%%#" /quiet /norestart ) Echo Windows Update finished. Pause&Exit 

You can also compress the folder (updates + script) into a standalone executable using winrar to distribute it as a separate file.

Information:

Wusa .exe is a Windows Update command-line application .

Files are processed one by one, and not all at the same time.

The quiet switch makes the installation silent.

The norestart switch does not restart after the update is installed, even if necessary.

If the update is installed on the OS, then it is not installed again, without getting an error window or stopping the script.

PS: see Wusa /? for more switches.

Hope this helps.

UPDATE:

Another option is to download and install ALL updates using the WSUS utility.

http://download.wsusoffline.net/

Updates for Win7 x64 (for example) are stored here: "... \ wsusoffline \ client \ w61-x64 \ glb"

PS: the batch file "DoUpdate.cmd" in the "CMD" dialog box of the application is what you need if you need to automate the task in the background.

enter image description here

+7
source

The most expensive time for the WindowsUpadate process is downloading the configuration files for updates. You should look at the locales on the installed WUS (Window Update Server) network and make sure that the PC is updated with WUS. If all computers are in the ActiveDirectory domain, the necessary settings are very easy to manage. But if this parameter cannot make a simple batch script that uses the usual Windows update procedure.

Another solution would be to create batch scripts in which you installed preloaded file updates using a keyless switch. In Allmoast, each setup.exe has such a quiet switch. If an update is not required, the update automatically stops for this download. I am using such a wizzardy batch script now for a relaxing time.

PS: If the computer was from one or your company, you should "thank" your predecessor for the many hours of work in the distant future.

PPS: By the way, XP and Vista should be phased out. They are now very old, and for XP already extended support time at Microsoft will be released by Microsoft next year and should be used only if it is really necessary for one small situation where Windows 7 is not a solution in any way.

+1
source

For start

 cssript.exe ZTIWindowsUpdate.wsf 

as an Administrator after a reboot, you can create a Task in the Task Scheduler with the appropriate permissions and run it at boot. =]

+1
source

The automatic way is WuInstall . I’ve been using it for 1 year now and it’s perfect, it really does what it should. This is a command line tool that automatically searches for, downloads, and installs updates. There are several β€œswitches” that let you customize the process. For example, thanks to a reboot of the switch, updating the updated PC is carried out with ease - at a time.

+1
source

Here is another way ------ Follow the instructions below at your own risk . To automate updating Windows, these instructions may or may not work for your system, however, it seems to work to the extent that it works for Windows 7, since these instructions have been tested on Windows 7.

MUST READ: 1. If the step below does not work, verify that you are most likely part of the domain and your security policy may not allow you to complete the following steps! 2. UAC requests were also disabled during Windows updates, so batch files can be run without interruption; be careful to restore it to default when done

Caution This step will make your computer less secure; remove it immediately after your computer is fully updated. Set a reminder within 24 hours if necessary :

1. First you will need to make sure that your computer is automatically logged into the user's system. You can do this by clicking the "Start" menu, type "netplwiz", press "Enter" or open the wizard, under the "Users" tab, select your username and cancel "password request", enter the password and close this window.

2. Create 3 batch files to start the automated process. (Open notepad, paste each code into a separate notepad and save as the corresponding_file_name .bat)

One. Save as: any_name.bat, then copy this batch file to your startup folder for the user you made automatically. (Click Start> All Programs> Launch)

 start "" c:\autoupdate1.bat exit 

Two. Save as: autoupdate1.bat, then copy this to C: \ drive

 wuauclt /detectnow wuauclt /updatenow reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" > nul && shutdown -r -t 0 start "" c:\autoupdate2.bat exit 

Three. Save as: autoupdate2.bat, then copy this to C: \ drive

 ping 127.0.0.1 -n 61 > nul start "" c:\autoupdate1.bat exit 

Restart or open the batch file in the startup folder and see how the magic starts!

3. When this is done completely, simply delete the batch files from the startup folder and c: \ drive

Follow these instructions again at your own peril and risk, since it can create an endless loop if you do not know how to stop this process by deleting it from the startup folder or by going to windows in safe mode to delete batch files

Concluding remarks. If you are having trouble running batch files, you may need to look for a way to disable UAC prompts for your version of Windows.

+1
source

Source: https://habr.com/ru/post/943485/


All Articles