Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Usually on Windows XP, if I wanted to know the location of an installed program, I would just click 'Properties' and it would show where the executable is located.

On Windows 7, I do the same thing and I get this:

alt text

How can I find out where programs are located based on the shortcut? I did however notice that for some programs it does show a shortcut under the 'Target', but not in the case with iTunes for example.

share|improve this question

5 Answers 5

up vote 8 down vote accepted

What you are seeing are special shortcuts called Advertised Shortcuts. The shortcuts actually link to msiexec.exe which is the Windows Installer executable. Advertised shortcuts allow installer authors to install only portions of their application and then install additional pieces when they are accessed via the advertised shortcut. Windows Installer also automatically checks the integrity of all of the installed files each time the application is run so you can be sure the application is valid when it is run.

Here is a Stack Overflow question with a bit more info on advertised shortcuts.

Finding the executable the shortcut eventually runs is not a simple task and would involve some digging through the registry. Hugh's suggestion is likely much simpler.

share|improve this answer
    
Nice bit of supporting detail there +1 from me –  Joe Taylor Aug 19 '11 at 8:42

I have wondered the same thing for some shortcuts under win XP. I tried Cygwin's readshortcut but it didn't tell me the real target:

$ readshortcut.exe -fa "Microsoft Word.lnk"
Target: /cygdrive/c/WINDOWS/Installer/{00000409-78E1-11D2-B60F-006097C998E7}/wordicon.exe
Working Directory:
Arguments:
Show Command: Normal
Icon Library: /cygdrive/c/WINDOWS/Installer/{00000409-78E1-11D2-B60F-006097C998E7}/wordicon.exe
Icon Library Offset: 0
Description: Create and edit text and graphics in letters, reports, Web pages, or e-mail messages by using Microsoft Word.

So they're obviously something to do with Windows Installer. To find the executable, you can always just run it and use Process Explorer to get the path - in my case, C:\Program Files\Microsoft Office2K\Office\WINWORD.EXE.

share|improve this answer
    
+1 and it works, but this is terrible for security. If a suspicious application made its way on a computer, and you wanted to know what the shortcut points to without actually running it, Microsoft should have made this dead simple. But were left to our own devices jumping through hoops. How can we even guide little old grandma over the phone to do this. Rant over –  7wp Jun 18 at 17:44

For those looking to do this in PowerShell without using a module:

$lnk = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Adobe\Adobe Acrobat X Pro.lnk"
$WindowsInstaller = New-Object -ComObject WindowsInstaller.Installer
$ShortcutTarget = $WindowsInstaller.GetType().InvokeMember("ShortcutTarget","GetProperty",$null,$WindowsInstaller,$lnk)
$StringData1 = $ShortcutTarget.GetType().InvokeMember("StringData","GetProperty",$null,$ShortcutTarget,1)
$StringData3 = $ShortcutTarget.GetType().InvokeMember("StringData","GetProperty",$null,$ShortcutTarget,3)
$WindowsInstaller.GetType().InvokeMember("ComponentPath","GetProperty",$null,$WindowsInstaller,@($StringData1,$StringData3))
share|improve this answer
1  
+1 for the PowerShell goodness! –  HopelessN00b Jun 17 at 19:17
    
we need moar answers like this... WOO POWERSHELL –  Nacht Aug 25 at 5:38

Try either of the below (from Tek-Tips Forums):

VbScript

' GetRealTarget.vbs
' This version needs to be run under wscript engine rather than cscript

' Pass the full path to an MSI "Advertised Shortcut" lnk file (including the extension) as a parameter
' e.g. assuming that we have a default install of Office 2003 for All Users:
' GetRealTarget "C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2003.lnk" 
' Displays fully resolved target for the MSI shortcut

Option Explicit
Dim MSITarget

On Error Resume Next ' just some simple error handling for purposes of this example
If wscript.arguments.count = 1 Then ' did actually pass an MSI advertised shortcut? Or, at least, a parameter that could be such a thing?
   With CreateObject("WindowsInstaller.Installer")
      Set MSITarget = .ShortcutTarget(wscript.arguments(0))
      If Err = 0 then
         MsgBox .ComponentPath(MSITarget.StringData(1), MSITarget.StringData(3))
      Else 
         MsgBox wscript.arguments(0) & vbcrlf & "is not a legitimate MSI shortcut file or could not be found"
      End If
   End With
End If
On Error Goto 0

PowerShell (with the install of this Windows Installer Module)

get-msiproductinfo | where { $_.ProductState -match "Installed" } | fl AdvertisedProductName, InstallLocation
share|improve this answer

I had a similar issue and was able to use Task Manager (Ctrl-Alt-DeleteStart Task Manager) to find the application (after openingit) in the Applications tab.

Right-click on the desired application to bring up the menu and choose Go To Process. This shows which process is associated with the app in the Processes tab.

Then, right-click on the process to bring up the menu and choose either Properties or Open File Location to find out more.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.