6

I've tried to use Get-ChildItem to get installed program property information and it does provide some of the information I require but the Installed Location/path is usually blank. Given a program's name/displayname, is there a way reliable way to get the installation path of a Windows Server program (remote to other servers) using Powershell?

Thanks in advance.

0

2 Answers 2

6

Using Registry:

Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | 
% { Get-ItemProperty $_.PsPath } | Select DisplayName,InstallLocation

Using WMI:

Get-WmiObject -Class Win32_Product -Filter 'Name like "%Microsoft Office%"' | 
Select Caption,InstallLocation

For Remoting, Through registry it's totally different story, with WMI just add the -ComputerName Parameter (and make sure you have permissions)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Avshalom but they don't solve the problem of programs that don't have the InstallLocation property defined. Unfortunately, most programs don't have InstallLocation defined. Need another method.
4

You can use these cmdlets to get the paths:

Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | % { Get-ItemProperty $_.PsPath } | Select DisplayName,InstallLocation | Sort-Object Displayname -Descending

Get-ChildItem HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | % { Get-ItemProperty $_.PsPath } | Select DisplayName,InstallLocation | Sort-Object Displayname -Descending

These show different programs and their locations.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.