Hi everyone,
I have several shortcut files on my desktop and need to find out how to retrieve the target location of each shortcut goes programmatically. So far I managed to get all my link files on my desktop as shown in the code but I have no idea how to retrieve target location information from each shortcuts. Could anyone help please?
Code:
IDictionary environmentVariables = Environment.GetEnvironmentVariables();
string dd = environmentVariables["USERPROFILE"].ToString() + "\\Desktop";
string[] files= Directory.GetFiles(dd, "*.lnk");
foreach (string file in files) {
MessageBox.Show(file);
//Get target location of each lnk file
}