private void StartWindowsClicked(object sender, EventArgs e) { string Startup = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup); if (StartWithWindowsCK.Checked) { ShortcutTool.Create(Startup, AppName, Application.ExecutablePath, "/Startup", "A Social Media Picture Backuper Tool"); } else if (StartupStatus()) { File.Delete(ShortcutTool.GetShortcutPath(Startup, AppName)); } }
private bool StartupStatus() { string Startup = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup); return(File.Exists(ShortcutTool.GetShortcutPath(Startup, AppName))); }