(view source code of lastwupd.bat as plain text)
@ECHO OFF
SETLOCAL
SET RegKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
SET RegKey=%RegKey%\WindowsUpdate\Auto Update\Results\Install
FOR /F "skip=1 tokens=2*" %%A IN ('REG Query "%RegKey%" /v "LastSuccessTime"') DO SET LastWUpd=%%B
IF "%~1"=="" ECHO Last successful Windows Update: %LastWUpd%
ENDLOCAL & SET LastWUpd=%LastWUpd%
IF "%~1"=="" GOTO:EOF
:Syntax
ECHO.
ECHO LastWUpd.bat, Version 1.00 for Windows XP
ECHO Returns the date and time of the last successful Windows Update
ECHO.
ECHO Usage: LASTWUPD
ECHO.
ECHO Return: Displays a message with the date and time of the last
ECHO successful Windows Update, and saves this date and time
ECHO in an environment variable: LastWUpd=%LastWUpd%
ECHO.
ECHO Note: Tested only in Windows XP SP3 and Windows 7 RC
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
page last modified: 2024-04-16; loaded in 0.0084 seconds