I basically want to check if the current program is already linked to Windows Startup Folder, even if the file has another name or is ran from another directory. Is this possible, maybe by checking the program’s name?
PS: I use this code to link my program to the Startup folder:
using (ShellLink shortcut = new ShellLink()) {
shortcut.Target = Application.ExecutablePath;
shortcut.WorkingDirectory = Path.GetDirectoryName(Application.ExecutablePath);
shortcut.Description = "My Shorcut Name Here";
shortcut.DisplayMode = ShellLink.LinkDisplayMode.edmNormal;
shortcut.Save(Environment.GetFolderPath(Environment.SpecialFolder.Startup));
}
Thanks.
You need to scan startup’s start menu folder, and for each shortcut compare the target path with your program’s path.