using IWshRuntimeLibrary; // Select the "COM" tab, find and select the "Windows Script Host Object Model" private void CreateShortcut() { try { WshShell lib = new WshShell(); IWshShortcut _startupShortcut; string _programs = Environment.GetFolderPath(Environment.SpecialFolder.Programs); _startupShortcut = (IWshShortcut)lib.CreateShortcut(_programs + "\\" + Assembly.GetExecutingAssembly().GetName().Name + "\\" + Assembly.GetExecutingAssembly().GetName().Name + ".lnk"); _startupShortcut.TargetPath = Assembly.GetEntryAssembly().Location; _startupShortcut.WorkingDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); _startupShortcut.Description = Assembly.GetExecutingAssembly().GetName().Name; _startupShortcut.Save(); } catch (Exception ex) { EasyLogger.Error(ex); } }