Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); //Windows Script Host Shell Object
- dynamic shell = Activator.CreateInstance(t);
- try
- {
- string appfolder = Path.Combine(Environment.User "LoL Login Screen Randomizer.lnk");
- var lnk = shell.CreateShortcut(appfolder);
- try
- {
- lnk.TargetPath = Application.ExecutablePath;
- lnk.IconLocation = Application.ExecutablePath + ", 0";
- lnk.Save();
- }
- finally
- {
- Marshal.FinalReleaseComObject(lnk);
- }
- }
- finally
- {
- Marshal.FinalReleaseComObject(shell);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement