Advertisement
Guest User

Untitled

a guest
Jul 28th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); //Windows Script Host Shell Object
  2. dynamic shell = Activator.CreateInstance(t);
  3. try
  4. {
  5. string appfolder = Path.Combine(Environment.User "LoL Login Screen Randomizer.lnk");
  6. var lnk = shell.CreateShortcut(appfolder);
  7. try
  8. {
  9. lnk.TargetPath = Application.ExecutablePath;
  10. lnk.IconLocation = Application.ExecutablePath + ", 0";
  11. lnk.Save();
  12. }
  13. finally
  14. {
  15. Marshal.FinalReleaseComObject(lnk);
  16. }
  17. }
  18. finally
  19. {
  20. Marshal.FinalReleaseComObject(shell);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement