PC Review


Reply
Thread Tools Rate Thread

Batch file to delete existing shortcuts

 
 
ano1optimist
Guest
Posts: n/a
 
      25th May 2006
I'm trying to code a batch file that will delete any existing icons
with a filename of *text*.lnk that reside on the local C drive. I can
run the commands at a command prompt but when I execute them in a batch

program, I get unexpected results. How can I accomplish this task?

 
Reply With Quote
 
 
 
 
Gary Smith
Guest
Posts: n/a
 
      26th May 2006
ano1optimist <(E-Mail Removed)> wrote:
> I'm trying to code a batch file that will delete any existing icons
> with a filename of *text*.lnk that reside on the local C drive. I can
> run the commands at a command prompt but when I execute them in a batch


> program, I get unexpected results. How can I accomplish this task?


The resident mind reader is on vacation. You need to tell us what
commands you're using at the command prompt and precisely what happens
when you try to use them in the batch file.

--
Gary L. Smith
Columbus, Ohio
 
Reply With Quote
 
Todd Vargo
Guest
Posts: n/a
 
      26th May 2006

"Gary Smith" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> ano1optimist <(E-Mail Removed)> wrote:
> > I'm trying to code a batch file that will delete any existing icons
> > with a filename of *text*.lnk that reside on the local C drive. I can
> > run the commands at a command prompt but when I execute them in a batch

>
> > program, I get unexpected results. How can I accomplish this task?

>
> The resident mind reader is on vacation. You need to tell us what
> commands you're using at the command prompt and precisely what happens
> when you try to use them in the batch file.


And please don't multi-post.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      26th May 2006
On 25 May 2006 15:31:06 -0700, "ano1optimist" <(E-Mail Removed)> wrote:

>I'm trying to code a batch file that will delete any existing icons
>with a filename of *text*.lnk that reside on the local C drive. I can
>run the commands at a command prompt but when I execute them in a batch
>
>program, I get unexpected results. How can I accomplish this task?


for /f "Tokens=*" %%a in ('dir c:\*test*.lnk /b /s /a') do del /q /f "%%a"

AND DON'T MULTI-POST!

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy shortcuts in a batch file Diane Walker Microsoft Windows 2000 File System 6 8th Mar 2008 01:38 PM
How do I use a batch file to delete index.dat? Anonymous Microsoft Windows 2000 2 7th Mar 2006 06:51 AM
Batch file to Delete Cookies =?Utf-8?B?V2lsbGlhbQ==?= Microsoft Windows 2000 CMD Promt 4 21st Apr 2004 03:09 AM
Batch File to delete subdirectories that are named in a text file =?Utf-8?B?RGF2ZUY=?= Windows XP Performance 2 12th Feb 2004 09:54 PM
Batch file to delete a registry key Larry Microsoft Windows 2000 Registry Archive 0 20th Aug 2003 10:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 AM.