Break on
$rc = RedirectOutput("D:\TestInventory.txt")
$AppData = WMIInstalledProducts() 
For $index = 0 to UBound($AppData)
	?
	? "Product Name: " + $AppData[$index][0]
	? "Product ID: " + $AppData[$index][1]
	? "Install Date: " + $AppData[$index][2]
	? "Install Path: " + $AppData[$index][3]
	? "Vendor: " + $AppData[$index][4]
	? "Version: " + $AppData[$index][5]
	? "Registered Owner: " + $AppData[$index][6]
	? "Registered Company: " + $AppData[$index][7]
Next
$rc = RedirectOutput("")
?
?"Done"
Sleep 200
;Region Software information
;FUNCTION       WMIInstalledProducts() 
; 
;ACTION         Reports the installed software products 
; 
;AUTHOR         Glenn Barnas 
; 
;VERSION        1.0 / 2014/01/10 
; 
;SYNTAX         WMIInstalledProducts([Host] [,AuthPtr]) 
; 
;PARAMETERS     host    - OPTIONAL - name of system to query 
; 
;               AuthPtr - OPTIONAL - pre-authenticated WMI object pointer 
;                 Use WMIAuthentication() udf to create the AuthPtr value 
;                 AuthPtr is not needed if user has admin rights 
; 
;REMARKS        Filters out secondary components of primary products 
; 
;RETURNS        An array of Arrays. Each inner array consists of the following values: 
;			0. Product Name 
;			1. Product ID 
;			2. Install Date (yyyymmdd) 
;			3. Install Path 
;			4. Vendor 
;			5. Version 
;			6. Registered Owner 
;			7. Registered Company 
; 
;DEPENDENCIES   WMI 
; 
;TESTED WITH    WXP, W2K3, W2K8, W2K12, Win7, Win8 
; 
;EXAMPLES        
; 
Function WMIInstalledProducts(OPTIONAL $_Target, $_pAuth)
	 
	Dim $_objWMIService, $_objItem, $_colItems 		; WMI Object pointer and collection vars 
	Dim $_Ok 						; Process flag 
	Dim $_P 						; Pointer var 
	Dim $_aData, $_aRec[7] 				; array of collected data, working record array 
	 
	$_P = -1
	 
	; insure a properly formatted computer name, default to local computer is not specified 
	$_Target = IIf(Not $_Target, '.', Join(Split($_Target, '\'), ''))
	 
	; If a pre-authenticated WMI object pointer was provided, use it, otherwise create a new object pointer 
	If $_pAuth
		$_objWMIService = $_pAuth
	Else
		$_objWMIService = GetObject('winmgmts:{impersonationLevel=impersonate}!\\' + $_Target + '\root\cimv2')
		If @ERROR Exit Val('&' + Right(DecToHex(@ERROR), 4)) EndIf
	EndIf
	 
	$_objWMIService = GetObject('winmgmts:\\' + $_Target + '\root\cimv2')
	$_colItems = $_objWMIService.ExecQuery('Select * from Win32_Product',, 48)
	 
	For Each $_objItem in $_colItems
		$_Ok = 1
		 
		; =========================================================================== 
		; The following SELECT/CASE block can be adjusted by the code author to  
		; filter out the secondary app components that don't need to be logged. 
		; Those provided here are an example of typical secondary components. 
		; =========================================================================== 
		
		Select
			;Case Not Trim($_objItem.InstallLocation) 		; Can't be blank 
			;	$_Ok = 0
			Case InStr($_objItem.InstallLocation, '1Common Files') ; Must be a unique folder, not common 
				$_Ok = 0
			Case InStr($_objItem.InstallLocation, '1\Users\') 	; exclude personal settings 
				$_Ok = 0
			Case InStr($_objItem.Name, '1MSVCRT') 		; Exclude MS Visual C Runtime 
				$_Ok = 0
			Case InStr($_objItem.Name, '1 Live ') 		; Exclude Live components 
				$_Ok = 0
			Case InStr($_objItem.Name, '1MUI') 			; Exclude language packs 
				$_Ok = 0
			Case InStr($_objItem.Name, '1Engine') 		; Exclude add-on 
				$_Ok = 0
			Case InStr($_objItem.Name, '1Wrapper') 		; Exclude add-on 
				$_Ok = 0
			Case InStr($_objItem.Name, '1Office Proof') Or InStr($_objItem.Name, "1vérification linguistique")		; Exclude office proofing tools (assumed installed if Office is installed) 
				$_Ok = 0
			Case InStr($_objItem.Name, '1IME') 			; Exclude office InputMethodEditor aka IME (assumed installed if Office is installed) 
				$_Ok = 0
		EndSelect
		; =========================================================================== 
		If $_Ok
			$_P = $_P + 1 					; increase the array size 
			ReDim Preserve $_aData[$_P] 			; extend the array 
			ReDim $_aRec[7]
			$_aRec[0] = $_objItem.Name
			$_aRec[1] = $_objItem.ProductID
			$_aRec[2] = $_objItem.InstallDate
			$_aRec[3] = $_objItem.InstallLocation
			$_aRec[4] = $_objItem.Vendor
			$_aRec[5] = $_objItem.Version
			$_aRec[6] = $_objItem.RegCompany
			$_aRec[7] = $_objItem.RegOwner
			$_aData[$_P] = $_aRec 				; store the record in the array 
		EndIf
	Next
	 
	$WMIInstalledProducts = $_aData 			; return the compound array 
	 
	Exit 0
	 
EndFunction
;endregion