I want to check shortcut of any installed software on user desktop is exists or not by C# programmatically. If exists then I want to change the rename of that shortcut. How to do this?
I tried this code to find shortcut but it's not well working. Shortcut file is exists but it displays "Shortcut File not found"
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string shortcutfile = desktopPath + "\\Mozilla Firefox.lnk";
if (File.Exists(shortcutfile))
{
MessageBox.Show("Shortcut File found");
}
else
{
MessageBox.Show("Shortcut File not found");
}
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string shortcutfile = desktopPath + "\\Mozilla Firefox.lnk";
if (File.Exists(shortcutfile))
{
MessageBox.Show("Shortcut File found");
}
else
{
MessageBox.Show("Shortcut File not found");
}

Joginder BangerRank #360 · 7K reputationPosted Mar 21, 2016, 5:28 AM EDT
amir elshater31 reputationPosted Jun 17, 2020, 8:42 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Mar 21, 2016, 4:21 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts