Avatar of janhoedt
janhoedt
 asked on

Get fullname application via exepath, powershell

Hi,

I have an executable path, f.e. C:\Program Files (x86)\XMind\XMind.exe.
How do I get the full name of the program via Powershell?

J
Powershell

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
Noah

Hi there! :)

Please try this.

get-childitem "C:\Program Files (x86)\XMind\XMind.exe" -recurse | where {$_.extension -eq ".exe"} | % {
     Write-Host $_.FullName
}

Open in new window

Alex

get-childitem "C:\Program Files (x86)\XMind\XMind.exe" | select-object Fullname

Not really any need for the recurse, the where either, Or the write host for that matter.
Noah

Alternatively, you can do this!

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize

Open in new window

Your help has saved me hundreds of hours of internet surfing.
fblack61
Alex

A better question though, what is it you're actually trying to do, I know you've said you want the full name in powershell, but what are you actually trying to achieve?

Regards
Alex
Noah

@Alex Good point! Thanks. I did that because he did specify the file path leading to an .exe anyway.
Alex

Yeah but he's given you the "Leaf" object, you've already specified the entire path, your script would work fine don't get me wrong, but your script would be better utilised if you're pulling multiple objects from a higher level folder.

If you wanted to pull all EXE files from say, The Microsoft Office folder. Yes it'd work perfectly and if that's what he actually needs rather than what he's explained then your script is the much better option.

:-)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
janhoedt

ASKER
>what  do you want to achieve

"C:\Program Files (x86)\XMind\XMind.exe.
How do I get the full name of the program via Powershell?"

None of the solutions givee the full name. What works for another exe. f.e. Wors is get-item pathtoexe select versioninfo |select *

I want to map path of exe to full application name and version via Powershell
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.