How do I find the Target of an Advertised shortcut?

14

2

EDIT: Originally I used the title "How do I find the Target of a MS-Office shortcut?" but have since changed it as the problem is not specific to MS-Office shortcuts.

I have MSOffice 2010 OneNote installed, the shortcut in the Start menu has the following properties:

enter image description here

As you can see the Target information is generic and the Find Target button is greyed out.

How do I find the file the shortcut is pointing to?

EDIT: I was looking for the Target of the shortcut so I could use it with one of the "Favourite" keys on my Microsoft keyboard. However, in getting caught up in wanting to find the location of the Target I forgot that I could just set the favourite to point to this shortcut, not the executable.

Although that solves my issue it still leaves we wanting to know how to find the location of the Target files in Advertised shortcuts.

Tony

Posted 2011-03-28T12:30:59.903

Reputation: 328

Question was closed 2014-06-11T11:09:06.190

Answers

4

It appears that these are "Advertised Shortcuts" i.e. they break certain functionality such as the "Find Target" function in order to allow it to show information about the program like the Excel shortcut saying "Performs Calculations blah blah blah"

It appears to have annoyed more than a few people on the internet:

http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-setup/1894/Setup-creates-shortcut-with-find-target-grayed

Ah, looks like it has been asked on SO: https://stackoverflow.com/questions/1270779/why-is-the-target-disabled-in-dot-net-shortcuts-after-setup

Mokubai

Posted 2011-03-28T12:30:59.903

Reputation: 64 434

The link to dotnetmonster points to an unregistered domain for me at the moment. – Matthew – 2016-06-09T14:15:05.930

While useful information, I don't see how this actually answers the question. – Neutrino – 2017-01-04T15:38:39.767

Interesting, thanks for the information about Advertised Shortcuts. The discussions regarding fixing the Target buttons is useful but in this case I just want to know how to find out what this shortcut points to. I've updated the question with some more info. – Tony – 2011-03-28T13:06:00.387

1@Tony, The best I can do is to open up notepad and drop the .lnk file into that, in amongst all the garbage is (for Excel at least) a string that looks like "C . . \ . . \ . . \ . . \ . . \ . . \ P r o g r a m F i l e s \ M i c r o s o f t O f f i c e \ O f f i c e 1 2 \ E X C E L . E X E" – Mokubai – 2011-03-28T14:11:50.567

5

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

user66001

Posted 2011-03-28T12:30:59.903

Reputation: 1 050

-3

All the executables of Office 2010 should be in C:\Program Files\Microsoft Office\Office14\.

Deniz Zoeteman

Posted 2011-03-28T12:30:59.903

Reputation: 1 001

1-1 Doesn't answer the question asked. – user66001 – 2015-12-07T17:50:13.610

That path does not exist on my computer. I have Office 2007 installed and only OneNote from 2010 (this is a work computer, not personal) – Tony – 2011-03-28T12:54:45.977

if you have 64 bit computer it might be in Program Files (x86). – Deniz Zoeteman – 2011-03-28T13:38:24.953

I have a 64-bit computer but am stuck on XP (until the company decide to upgrade). I searched for OneNote.exe and found it in C:\Program Files\Microsoft Office 2007\Office14 so you were close :) Of course, I should have just searched for it in the first place but I'm still interested to know how to resolve the Target of an Advertised shortcut. – Tony – 2011-03-28T13:48:21.443