• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Fast and easy?

How do I delete shortcuts.

I have a folder with a shortcut under programs in the start menu, then I have one shortcut on the desktop.

Any easy way to delete these???

/Fixzy
0
Fixzy
Asked:
Fixzy
  • 3
  • 3
  • 2
1 Solution
 
gmayoCommented:
Shortcuts are ordinary files with a .lnk extension, so you can use DeleteFile('filename.lnk') or equivalent. If you don't know the location of your shortcuts then that is a bit of a problem. You can search for it I suppose, and read the file to make sure it points to your app. If you are using an installer (like InstallShield) it will delete any shortcuts it creates when you uninstall the app.

Geoff M.
0
 
FixzyAuthor Commented:
Okey...but where are these lnk files...how should I know in what folder they are and delete them.

/Fixzy
0
 
gmayoCommented:
They're wherever you put them. They are not in a central location. For example, the shortcuts on your desktop will be in the Desktop folder ("C:\Documents and Settings\Geoff Mayo\Desktop" for me on XP, will be different for different operating systems). Shortcuts in the Start Menu will be in the Start Menu folder ("C:\Documents and Settings\Geoff Mayo\Start Menu\Programs" or deeper).

Geoff M.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Eddie ShipmanAll-around developerCommented:
Use SHGetSpecialFolderLocation to obtain the path to the directory(ies) containing these files
0
 
gmayoCommented:
But, as already said, they are wherever you put them. I quoted the desktop and start menu as examples of where many .lnk files are, but they can exist in any directory.

Geoff M.
0
 
Eddie ShipmanAll-around developerCommented:
Tis true. I have seen classes on Torrys that can obtain the info from a .lnk file.
0
 
FixzyAuthor Commented:
Anyone who has a bice of code that I can use, I must be able to delete the shortcuts in both Win98, XP and 2000.

/Fixzy
0
 
Eddie ShipmanAll-around developerCommented:
Try this one...

TShortcut Link v.1.1  By Elliott Shevin.

TShortcutLink is a non-visible component encapsulating functions for creating
shortcut files and extracting the properties of existing ones. This component
makes it easy to put a shortcut on the Windows desktop, Start menu,
Programs menu, Startup folder, or any other place you choose; and to <b>obtain
the properties of an existing shortcut, such as its target.</b>

Fully functional
Source: Included

 
Download: http://www.torry.net/vcl/system/shell/esshortcut.zip

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now