// Remove WinEdt Links

Requires(20010724); // Requires this build of WinEdt to work properly

// Write the Log File:
OpenOutput('%b\WinEdt Remove Links.log');
// Insert the general information ...
GetDate(9, 'dddd, mmmm d, yyyy "at" hh:nn'); // Date Stamp

WrL(`WinEdt Remove Links.log`);
WrL(`Last modified on: `);
WrL(`  %!9%\`);

// Prepare the Checkbox Dialog

WrL;
WrL(`Removing Links to WinEdt:`);
WrL;

LetReg(0,"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders");

WrL;
WrL(`Current User:`);
WrL;

LetReg(1,'HKEY_CURRENT_USER');
LetReg(2,'');

LetReg(3, "%@('%!1','%!0','%!2Desktop');");
IfFileExists('%!3\WinEdt 10.lnk',>
  !'DeleteFile("%!3\WinEdt 10.lnk");>
    IfOK(!''WrL("  Desktop Deleted: ""%!3\WinEdt 10.lnk""");'',>
         !''WrL("  Desktop Delete Error: ""%!3\WinEdt 10.lnk""");'');>
   ');

LetReg(3, "%@('%!1','%!0','%!2Programs');");
IfFileExists('%!3\WinEdt 10.lnk',>
  !'DeleteFile("%!3\WinEdt 10.lnk");>
    IfOK(!''WrL("  Start Menu Deleted: ""%!3\WinEdt 10.lnk""");'',>
         !''WrL("  Start Menu Delete Error: ""%!3\WinEdt 10.lnk""");'');>
   ');

LetReg(3, "%@('%!1','%!0','%!2SendTo');");
IfFileExists('%!3\WinEdt 10.lnk',>
  !'DeleteFile("%!3\WinEdt 10.lnk");>
    IfOK(!''WrL("  Send To Deleted: ""%!3\WinEdt 10.lnk""");'',>
         !''WrL("  Send To Delete Error: ""%!3\WinEdt 10.lnk""");'');>
   ');

LetReg(3, "%@('%!1','%!0','%!2AppData');\Microsoft\Internet Explorer\Quick Launch");
IfFileExists('%!3\WinEdt 10.lnk',>
  !'DeleteFile("%!3\WinEdt 10.lnk");>
    IfOK(!''WrL("  Quick Launch Deleted: ""%!3\WinEdt 10.lnk""");'',>
         !''WrL("  Quick Launch Delete Error: ""%!3\WinEdt 10.lnk""");'');>
   ');

WrL;
WrL(`Local Machine (All Users):`);
WrL;

LetReg(1,'HKEY_LOCAL_MACHINE');
LetReg(2,'Common ');

LetReg(3, "%@('%!1','%!0','%!2Desktop');");
IfFileExists('%!3\WinEdt 10.lnk',>
  !'DeleteFile("%!3\WinEdt 10.lnk");>
    IfOK(!''WrL("  Desktop Deleted: ""%!3\WinEdt 10.lnk""");'',>
         !''WrL("  Desktop Delete Error: ""%!3\WinEdt 10.lnk""");'');>
   ');

LetReg(3, "%@('%!1','%!0','%!2Programs');");
IfFileExists('%!3\WinEdt 10.lnk',>
  !'DeleteFile("%!3\WinEdt 10.lnk");>
    IfOK(!''WrL("  Start Menu Deleted: ""%!3\WinEdt 10.lnk""");'',>
         !''WrL("  Start Menu Delete Error: ""%!3\WinEdt 10.lnk""");'');>
   ');

WrL;
CloseOutput;

End;
