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

Discussion in 'Operating Systems' started by Leros, Apr 7, 2006.

  1. Leros

    Leros Lifer

    Joined:
    Jul 11, 2004
    Messages:
    21,883
    Likes Received:
    6
    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?
     
  2. Loading...

    Similar Threads - delete shortcut batch Forum Date
    Getting Permission to Delete temp files in Win 7 Operating Systems Aug 20, 2016
    Win 10 install 'bonked', what to delete before trying again? Operating Systems Jul 29, 2016
    Trying to completely disable history delete in IE11 Operating Systems Jul 20, 2016
    Deleted some shortcuts in the Vista start menu... Operating Systems Mar 13, 2009
    My Internet shortcuts delete themselves Operating Systems Oct 14, 2006

  3. nweaver

    nweaver Diamond Member

    Joined:
    Jan 21, 2001
    Messages:
    6,813
    Likes Received:
    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.
     
  4. cubby1223

    cubby1223 Lifer

    Joined:
    May 24, 2004
    Messages:
    13,526
    Likes Received:
    41
    delete teatimer.lnk
     
  5. Leros

    Leros Lifer

    Joined:
    Jul 11, 2004
    Messages:
    21,883
    Likes Received:
    6
    thats exactly what i needed to know, thanks.
     
  6. MadRat

    MadRat Lifer

    Joined:
    Oct 14, 1999
    Messages:
    11,604
    Likes Received:
    0
    It will be funny if your antivirus flags this as a maliscious script.
     
  7. jfunk

    jfunk Golden Member

    Joined:
    Oct 16, 2000
    Messages:
    1,208
    Likes Received:
    0
    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

     
  8. Leros

    Leros Lifer

    Joined:
    Jul 11, 2004
    Messages:
    21,883
    Likes Received:
    6
    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.