예제 #1
0
        public void NewStartupShortcut()
        {
            var selectFilePathes = _selectExecuteFileService.SelectExecuteFiles();

            foreach (var filePath in selectFilePathes)
            {
                var fileNameWithoutExt = Path.GetFileNameWithoutExtension(filePath);
                var shortcut           = new Shortcut()
                {
                    Arguments        = "",
                    Description      = "Make by StartupConfigurerWin10",
                    FullName         = Path.Combine(StartupPath, fileNameWithoutExt + ".lnk"),
                    IconLocation     = filePath + ",0",
                    TargetPath       = filePath,
                    WindowStyle      = WindowStyle.Normal,
                    WorkingDirectory = ""
                };

                _shortcutService.SaveShortcut(StartupPath, shortcut);
            }
        }