Tom Knowlton
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
are you sure you're looking at the right desktop/profile? what windows version are you using?
ASKER
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.u rl");
File.Delete("C:\\docume~1\ \alluse~1\ \desktop\\ allian~1.l nk");
}
}
}
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\\
File.Delete("C:\\docume~1\
}
}
}
ASKER
Windows XP Pro is my OS.
ASKER
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?