Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Delete shortcut off of the desktop

I have a few shortcuts on my desktop that are put there by my login script.  The shortcuts bug me, but I don't want to bother IT to remove this from the login script.

Please provide C# code that will allow me to remove the shortcuts to the Recycle Bin and then empty the Recycle Bin.
ASKER CERTIFIED SOLUTION
Avatar of GrnEggsAndHam
GrnEggsAndHam

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Knowlton

ASKER

GrnEggsAndHam:

Now I feel really really REALLY dumb....  :)

It really is that easy.


Now....this works fine for ONE of the links.......but what is weird is that the OTHER link....is on my Desktop.....but does not show up in my directory listing of the Desktop (from command.com)

What would cause a link not to show up?
Avatar of GrnEggsAndHam
GrnEggsAndHam

are you sure you're looking at the right desktop/profile?  what windows version are you using?
GrnEggs:

It was another Desktop!!!!


I have (it seems) two Desktops that are MERGING...one on my Y:  drive   and one on my  C:  drive.....


It's working now, here's the code:

using System;
using System.IO;

namespace DeleteNovatekShortcuts
{
      class Class1
      {
            [STAThread]
            static void Main(string[] args)
            {                  
                  File.Delete("Y:\\Desktop\\mcmast~1.url");
                  File.Delete("C:\\docume~1\\alluse~1\\desktop\\allian~1.lnk");                  
            }
      }
}


Windows XP Pro is my OS.