Go Back   AnandTech Forums > Software > Operating Systems

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Home and Garden
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals with Free Stuff/Contests
· Black Friday 2014
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 04-07-2006, 08:01 PM   #1
Leros
Lifer
 
Leros's Avatar
 
Join Date: Jul 2004
Location: Austin, TX
Posts: 21,648
Default How do I delete a shortcut with a batch file? (Win XP)

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 "CDocuments and Settings\Justin\Desktop\TeaTimer"


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

How do I delete this shorcut?
Leros is offline   Reply With Quote
Old 04-07-2006, 08:44 PM   #2
nweaver
Diamond Member
 
Join Date: Jan 2001
Posts: 6,813
Default How do I delete a shortcut with a batch file? (Win XP)

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.
nweaver is offline   Reply With Quote
Old 04-07-2006, 09:27 PM   #3
cubby1223
Lifer
 
Join Date: May 2004
Posts: 11,719
Default How do I delete a shortcut with a batch file? (Win XP)

delete teatimer.lnk
cubby1223 is offline   Reply With Quote
Old 04-07-2006, 10:02 PM   #4
Leros
Lifer
 
Leros's Avatar
 
Join Date: Jul 2004
Location: Austin, TX
Posts: 21,648
Default How do I delete a shortcut with a batch file? (Win XP)

thats exactly what i needed to know, thanks.
Leros is offline   Reply With Quote
Old 04-07-2006, 10:13 PM   #5
MadRat
Lifer
 
Join Date: Oct 1999
Posts: 11,604
Default How do I delete a shortcut with a batch file? (Win XP)

It will be funny if your antivirus flags this as a maliscious script.
__________________
Go Huskers!
MadRat is offline   Reply With Quote
Old 04-07-2006, 11:25 PM   #6
jfunk
Golden Member
 
Join Date: Oct 2000
Posts: 1,208
Default How do I delete a shortcut with a batch file? (Win XP)

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

__________________
j
jfunk is offline   Reply With Quote
Old 04-07-2006, 11:30 PM   #7
Leros
Lifer
 
Leros's Avatar
 
Join Date: Jul 2004
Location: Austin, TX
Posts: 21,648
Default How do I delete a shortcut with a batch file? (Win XP)

Quote:
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.

Leros is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:03 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.