Solved

How can I read the Location property from the general tab of a shortcut in the Start Menu using C# ?

Posted on 2014-03-16
1
131 Views
Last Modified: 2014-10-15
How do can I read the Location property shown on the "General" tab of a shortcut listed in the Start Menu All Programs area when I view its properties using a C# program?

I am able to read the properties from the IWshShortcut object from the IWshRuntimeLibrary assembly but that object does not contain the value of the "Location" shown in the shortcut properties General tab.
0
Comment
Question by:zonkerman
1 Comment
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 39935068
From what I can see the Location is simply derived from the TargetPath, so just parse it out using the Path object, i.e.

Path.GetDirectoryName( myShortcut.TargetPath );

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question