Skip to content

Instantly share code, notes, and snippets.

@mkropat
Last active March 15, 2019 00:01
Hands-off script to fully patch a fresh Windows install
:: autoupdate.bat - hands-off script to fully patch a fresh Windows install (https://git.io/vzWKw)
::
:: Usage: save this file to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup and run it
::
:: Derived from a post by EzR (http://serverfault.com/a/732084/55554)
:begin
wuauclt /DetectNow
wuauclt /UpdateNow
reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" >nul 2>&1 && shutdown -r -t 0
timeout /t 60
goto begin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment