Exemplo n.º 1
0
        public static bool CreateLnk(string path, string lnkPath, string imagePath, string args)
        {
            if (String.IsNullOrEmpty(lnkPath))
            {
                return(false);
            }

            if (_Shell == null)
            {
                _Shell = new WshShellClass();
            }

            var lnk = _Shell.CreateShortcut(path) as IWshShortcut;

            lnk.TargetPath   = lnkPath;
            lnk.IconLocation = imagePath;
            lnk.Arguments    = args;
            lnk.Save();

            return(true);
        }