So I have a really frustrating problem. I have a WPF application written in C# running Windows 10 (version 1703, OS Build 15063.0) that creates shortcuts for the current running executable. The problem is, when I create these, I set a different (custom) icon for the shortcuts. I didn't think this would be an issue, but the next time I run the application (from the original location) it displays the custom icon which I set for the shortcut in the taskbar. Just the taskbar. The title bar and task manager show the correct icon and title. What am I doing wrong here? At this point I think it's a Windows bug. My method for creating the shortcuts is below:
public void CreateShortcut(string name)
{
string AppDir = GetAppDataDir();
object shDesktop = (object)"Desktop";
WshShell shell = new WshShell();
string shortcutAddress = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\" + name + ".lnk";
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
shortcut.Description = "Play " + name + "!!";
shortcut.Hotkey = "Ctrl+Shift+N";
shortcut.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
shortcut.TargetPath = Directory.GetCurrentDirectory() + "/Catapult.exe";
shortcut.Arguments = "-play \"" + name + "\"";
shortcut.IconLocation = AppDir + "/Games/" + name + ".ico";
shortcut.Save();
}