How do I delete a shortcut with a batch file? (Win XP)

Leros

Lifer
Jul 11, 2004
21,867
7
81
I have a tea timing program that creates a shortcut for itself on the desktop when it executes. Being that I keep my desktop empty (no icons), this is really annoying. I want to create a batch file that opens the program, waits a seconds, then deletes the shorcut.

I know how to make basic batch files, but the DEL command does not seem to work on shortcuts.

DEL "C:\Documents and Settings\Justin\Desktop\TeaTimer"


It says it cannot find the file (the shortcut is named TeaTimer).

How do I delete this shorcut?
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
shortcuts have an extension (can't remember what it is, on my linux box atm). From command prompt, dir with a few swtichs (-u -s maybe??) shows the full name correctly.
 

MadRat

Lifer
Oct 14, 1999
11,961
278
126
It will be funny if your antivirus flags this as a maliscious script.
 

jfunk

Golden Member
Oct 16, 2000
1,208
0
76
It would be easier to just turn off desktop icons instead of deleting them all. Plus that way if you ever want them for some reason (somebody else using your computer that isn't too savvy or you are trying to talk somebody through how to do something, etc..), you can just turn them back on.

I'm with you though, I like no icons and a hidden task bar.



BTW, if you didn't know the option was there, just right-click on your desktop and select: Arrange Icons By--->Show Desktop Icons

 

Leros

Lifer
Jul 11, 2004
21,867
7
81
Originally posted by: jfunk
It would be easier to just turn off desktop icons instead of deleting them all. Plus that way if you ever want them for some reason (somebody else using your computer that isn't too savvy or you are trying to talk somebody through how to do something, etc..), you can just turn them back on.

I'm with you though, I like no icons and a hidden task bar.



BTW, if you didn't know the option was there, just right-click on your desktop and select: Arrange Icons By--->Show Desktop Icons

The problem is that I occasionally like to have icons and stuff on my desktop. I think of the desktop has a workspace rather than a place to store icons for my programs.

Right now I have a few mp3s, a pdf and a folder of pictures on my desktop.