Hi guys; I was wonderin' if someone would be able to help with this lil' batch file here. I'm trying to check when the last successful Windows Update was . Here is the code here ..
@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%
PAUSE
ENDLOCAL & SET LastWUpd=%LastWUpd%
IF "%~1"=="" GOTO:EOF
And this is the output I get:
Last successful Windows Update: 2009-10-14 09:02:52
I was wonderin' if there was a way to calcualte the difference from the time now ? So that the line can be changed to read:
Last successful Windows update was x years x months x days x hours x mins ago If that would be possible that would be awesome.
Thanks in advance guys,
Methical