26

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.

1

9 Answers 9

21

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.

2
  • Nice bit of supporting detail there +1 from me
    – Joe Taylor
    Aug 19, 2011 at 8:42
  • This is a great answer for the example used but it is not answering the original question which is "Windows 7 finding location of installed program" Somehow this became about "advertised shortcuts" I just want to find out where a program is located so that I can move it from my c: drive to another drive that has space (or I want to run the program from the command line for what ever reason) I have learned that MS chooses to hide the underlying path for various reason, ONE of which is this "advertiser's link" thing where there literally isn't a path. Apr 28, 2018 at 16:01
17

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.

1
  • 7
    +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, 2014 at 17:44
7

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.

6

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))
1
  • we need moar answers like this... WOO POWERSHELL
    – Nacht
    Aug 25, 2014 at 5:38
2

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
2

Open regedit and search the program name. It will take few "search again" (F3) but eventually you´ll find the folder.

In my case, it was under HKEY_CLASSES_ROOT\Applications\<name of app>\shell\open\command

1
  • Also from this SO answer - look in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
    – icc97
    Apr 19, 2016 at 9:27
0

If you have User Account Control active, then when UAC box comes up asking to Allow, Cancel, you often see another (overlooked by many) dropdown arrow under it with the title "Details". If you click on Details you should see the actual location of the target.

P.S. if I recall this issue goes way back past windows 7, even past XP, to win 98 where right clicking the shortcut, selecting properties, often wouldn't show the target. Then we had to start the app, open task manager, right click app in list, select go to process, right click process, select open file location (or sometimes properties). Now UAC makes for less steps.

0

A trick that may work is this: Startup CMD and run:

dir C:\iTunes /s /b

It would report any file or directory named exactly "iTunes" (not case sensitive). If you have more than one fixed drive, it may be needed to repeat for that drive as well.

Or, you can create a file in the "unknown folder" (here: iTunes), then look for that file on disk:

dir C:\*testfilenumber1* /s /b

-1

The simplest way to find out the place of an executable:

  1. Find the program on Start menu and move it to the desktop using right mouse button. This creates a link.
  2. Put pointer over link and click right mouse. Select "Properties"
  3. On that screen you have the full path to the executable. Copy to buffer and paste whenever you need.
2
  • Finding the program in start menu defeats the purpose. Further, finding it in start menu a lot of times will show you a "Advertised Shortcut" instead of the direct shortcut. The original question was how to get the direct shorctut to the physical executable from the special "Advertised Shortcut" type.
    – 7wp
    Dec 9, 2014 at 17:06
  • For my purposes, this was the best answer. Why it has a rank of -2 (at this moment, 28 April 2018) I don't know. The information about advertiser's links was interesting, and now I know that I can delete that spam, and no longer have to find the application because it's not on my hard drive. By there are times when I just want to be able to navigate to the executable file. This tip (move short cut to desktop via right click - and check the properties of THAT) is useful and I'm up voting it because it helped me. Apr 28, 2018 at 16:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .