PC Review


Reply
Thread Tools Rate Thread

Deleting folders in a dir

 
 
Phil
Guest
Posts: n/a
 
      6th Aug 2004
I'm trying to write a batch file which will delete any folders (and their
contents) that are contained within a dir, but none of the files that are in
the root of that dir.

The folders that are in the dir could have any name so it is impossible to
know what they may be called.

Been looking around but can't seem to find any way of doing this

I know that this might not really be the right newsgroup to use, but there
doesn't seem to be one that seems suitable. Hope you don't mind.

Has anyone got any ideas/tips?

Cheers for any help

Phil



 
Reply With Quote
 
 
 
 
Norman Bullen
Guest
Posts: n/a
 
      6th Aug 2004
Phil wrote:
> I'm trying to write a batch file which will delete any folders (and their
> contents) that are contained within a dir, but none of the files that are in
> the root of that dir.
>
> The folders that are in the dir could have any name so it is impossible to
> know what they may be called.
>
> Been looking around but can't seem to find any way of doing this
>
> I know that this might not really be the right newsgroup to use, but there
> doesn't seem to be one that seems suitable. Hope you don't mind.
>
> Has anyone got any ideas/tips?
>
> Cheers for any help
>
> Phil
>
>
>


You can probably do this with some combination of FOR statements. Type
HELP FOR > for.txt at the command line to get a long document about the
FOR command.

A gentleman named Timo Salmi regularly posts links to his Command Line
Scripting FAQ on comp.os.ms-windows.misc. There may be something in
there that you can use. Here's the link:
ftp://garbo.uwasa.fi/pc/link/tscmd.zip

Norm

--
--
To reply, change domain to an adult feline.

 
Reply With Quote
 
Guest
Posts: n/a
 
      10th Aug 2004
If you don't mind installing posix-ish tools like cygwin:

# use $rootdir/*, not $rootdir to keep
# $rootdir out of the results
find $rootdir/* -type d -exec rm -rf {} \;


>-----Original Message-----
>I'm trying to write a batch file which will delete any

folders (and their
>contents) that are contained within a dir, but none of

the files that are in
>the root of that dir.
>
>The folders that are in the dir could have any name so

it is impossible to
>know what they may be called.
>
>Been looking around but can't seem to find any way of

doing this
>
>I know that this might not really be the right newsgroup

to use, but there
>doesn't seem to be one that seems suitable. Hope you

don't mind.
>
>Has anyone got any ideas/tips?
>
>Cheers for any help
>
>Phil
>
>
>
>.
>

 
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
Deleting Folders & Backing up inbox and folders =?Utf-8?B?Y29tcHV0ZXJjbHVlbGVzcw==?= Microsoft Outlook Discussion 3 26th Jun 2005 08:22 PM
Deleting folders after deleting users =?Utf-8?B?Q2FybGVuYQ==?= Windows XP Basics 1 13th Apr 2004 03:39 AM
Annoyance: deleting folders from explorer Folders bar is slow OvErboRed Windows XP General 0 1st Jan 2004 09:02 AM
Annoyance: deleting folders from explorer Folders bar is slow OvErboRed Windows XP Help 0 1st Jan 2004 09:02 AM
Annoyance: deleting folders from explorer Folders bar is slow OvErboRed Windows XP Performance 0 1st Jan 2004 09:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:08 AM.