JSI Tip 7591. How do I determine the order that product updates were installed on a computer?

I have scripted WhenPU.bat to determine the order that product updates where installed on a specified computer.

WhenPU.bat uses the date of the the product update .log file in the %SystemRoot% folder, which it accesses by using the Admin$ share on the computer. A WPU_<ComputerName>.log file, created in the current directory, contains the list of installed updates, with the most recent update at the end of the list:

04/11/2003  23:03     8,489 Q331060.log
04/11/2003  23:03     6,416 Q329048.log
. . . .
05/29/2003  06:34     6,623 Q815021.log
06/15/2003  03:23     8,375 KB820291.log
. . . .
11/21/2003  04:48     3,424 KB817765.log
12/12/2003  14:27     14,200 KB826942.log
The syntax for using WhenPU.bat is:

WhenPU \[computername\]

where computername is an optional parameter that contains the NetBIOS name of the local or remote computer. If omitted, the %ComputerName% environment variable is used.

NOTE: If "\\computername\Admin$" is not reachable, ERRORLEVEL 99 is set, and a zero (0) byte WPU_<ComputerName>.log file is created.

NOTE: You can use Workstation.bat to run WhenPU.bat for all your domain computers, from your desktop.

WhenPU.bat contains:

@echo off
set computer=%computername%
if \{%1\}==\{\} goto FindWD
set computer=%1
set computer=%computer:\=%
set computer=%computer:"=%
call :WPULog >nul 2>&1
if ERRORLEVEL 1 endlocal&exit /b 99
exit /b 0
dir "\\%computer%\Admin$\*.log" /o:d | findstr /i /r /c:q......\.log /c:kb......\.log /c:q......uninst\.log/c:kb......uninst\.log >"WPU_%computer%.log"

NOTE: See When you try to remove a <product update>, you receive 'If <product update> is removed, these programs may not run correctly'?

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.