Solved

Fast and easy?

Posted on 2003-11-19
8
235 Views
Last Modified: 2010-04-05
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
Comment
Question by:Fixzy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 8

Expert Comment

by:gmayo
ID: 9782519
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
 

Author Comment

by:Fixzy
ID: 9782659
Okey...but where are these lnk files...how should I know in what folder they are and delete them.

/Fixzy
0
 
LVL 8

Accepted Solution

by:
gmayo earned 50 total points
ID: 9782682
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:EddieShipman
ID: 9782876
Use SHGetSpecialFolderLocation to obtain the path to the directory(ies) containing these files
0
 
LVL 8

Expert Comment

by:gmayo
ID: 9785824
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
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9787342
Tis true. I have seen classes on Torrys that can obtain the info from a .lnk file.
0
 

Author Comment

by:Fixzy
ID: 9799699
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
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9800059
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question