#207830 - 2013-09-30 01:36 PM
Application executable list showing last used
|
Stooker
Fresh Scripter
Registered: 2009-08-04
Posts: 7
Loc: UK
|
I've been running round in circles on this one, so hope someone can help.
For sometime now my Kix login script has collected installed application details by interrogating the HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall registry key. By looking at each key I gather an audit of applications that appear in Add/Remove programs.
I've now been asked to provide a 'last used' date for each application. The only way I've read that this could be obtained is by using the UDF fnGetFileProp to return the Date Last Accessed of an application's executable. Perhaps not the most reliable data, but it's all I've got!
My problem is that the Uninstall registry key doesn't give me a link to the application executable so that I can then query its Date Last Accessed property.
I've also quizzed the HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths registry key. It does provide a path to the executable, but not for all applications on the PC.
Soooo, I'm trying to produce a list of applications installed on a PC which includes its path to the executable to then query its Date Last Accessed.
I should say that the majority of my PCs are Windows XP Service Pack 3.
|
Top
|
|
|
|
#207833 - 2013-09-30 03:56 PM
Re: Application executable list showing last used
[Re: Lonkero]
|
Stooker
Fresh Scripter
Registered: 2009-08-04
Posts: 7
Loc: UK
|
Useful - NOT. Back in the real world, anyone else have any help.
|
Top
|
|
|
|
#207838 - 2013-10-01 11:55 AM
Re: Application executable list showing last used
[Re: It_took_my_meds]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Here is an OLD script I wrote back in the day, gathers software from HKLM, HKCU and WMI:
$=SetOption('Explicit','On')
Global $NameArray[], $VenArray[], $VerArray[]
Function GetSoftReg($uninstall)
Dim $i, $key, $x, $y, $ven, $ver
$i = 0
While EnumKey($uninstall,$i) <> "" And @ERROR = 0
$key = EnumKey($uninstall,$i)
$x = ReadValue($uninstall+$key,'DisplayName')
If $x <> ""
$ver = ReadValue($uninstall+$key,'DisplayVersion')
$ven = ReadValue($uninstall+$key,'Publisher')
If $ven = "" $ven = "NA" EndIf
If $ver = "" $ver = "NA" EndIf
$y = UBound($NameArray) + 1
ReDim Preserve $NameArray[$y]
ReDim Preserve $VerArray[$y]
ReDim Preserve $VenArray[$y]
$NameArray[$y] = $x
$VerArray[$y] = $ver
$VenArray[$y] = $ven
;? $NameArray[$y]
EndIf
$i = $i + 1
Loop
EndFunction
;Reg: 'DisplayName','DisplayVersion','Publisher'
;WMI: 'Name','Vendor','Version'
Function GetSoftWMI
Dim $objWMIService, $colItems, $objItem, $itm, $chk, $y, $x, $ven, $ver
$objWMIService = GetObject("winmgmts:\\.\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_Product",,48)
For Each $objItem in $colItems
$chk = "False"
For Each $itm in $NameArray
If $itm = $objItem.Name
$chk = "True"
EndIf
Next
If $chk = "False"
$ver = $objItem.Version
$ven = $objItem.Vendor
If $ven = "" $ven = "NA" EndIf
If $ver = "" $ver = "NA" EndIf
$y = UBound($NameArray) + 1
ReDim Preserve $NameArray[$y]
ReDim Preserve $VerArray[$y]
ReDim Preserve $VenArray[$y]
$NameArray[$y] = $objItem.Name
$VerArray[$y] = $ver
$VenArray[$y] = $ven
EndIf
Next
EndFunction
GetSoftReg("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\")
GetSoftReg("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\")
GetSoftWMI
$=RedirectOutput("D:\Software.log")
Dim $i
For $i = 0 to UBound($NameArray)
? $NameArray[$i]
Next
|
Top
|
|
|
|
#207844 - 2013-10-01 09:15 PM
Re: Application executable list showing last used
[Re: Arend_]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Here is an article that mentions Last Used Date, but it doesn't seem to list all software to me. For me it only lists 1 piece of software that isn't even installed :P Last Used Date
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 507 anonymous users online.
|
|
|