Hi All,

Can any please gimmeVB script.I want to delete the cached copy of msi and mst from c:\Windows\Installer.
Product code of the application is {18D6DCEF-5BB6-4994-BC38-C34534137245}.

Thanks in advance.
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


why would want to do that.

the only suggestion i have to remove that is remove the application.

if you dont want to remove the entire application then dont remove the cached copy either .
Answered 11/03/2008 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
I don't know why you would want this but here is a vbscript to fetch the cached location, you have to add the deletion code your-self.

Option Explicit
On Error Resume Next

Const ProductCode = "{18D6DCEF-5BB6-4994-BC38-C34534137245}"

Dim Installer : Set Installer = Nothing
Set Installer = CreateObject("WindowsInstaller.Installer")

If Not IsProductInstalled(ProductCode) Then Wscript.Quit

Dim InstallSource : InstallSource = Installer.ProductInfo(ProductCode, "LocalPackage")
Dim Transforms : Transforms = Installer.ProductInfo(ProductCode, "Transforms")

WScript.Echo "Cached package: " & InstallSource
WScript.Echo "Cached Transforms: " & Transforms

Set Installer = Nothing

'// check if designated product is installed
Function IsProductInstalled(ProductCode)
IsProductInstalled = False

Dim ProductState : ProductState = Installer.ProductState(ProductCode)
If ProductState <> 5 Then
Wscript.Echo "Product not installed (ProductState return: " & ProductState & ")"
Wscript.Echo "Please check the ProductCode"

Exit Function
End If

IsProductInstalled = True
End Function
Answered 11/03/2008 by: AngelD
Red Belt

Please log in to comment