Skip to content

Instantly share code, notes, and snippets.

@mkropat
Last active March 15, 2019 00:01
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mkropat/d0f6135d1e754a16b980 to your computer and use it in GitHub Desktop.
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