PC Review


Reply
Thread Tools Rate Thread

Delete all files except one folder

 
 
liu
Guest
Posts: n/a
 
      9th Jun 2010
I have over 200 folders I need to delete all the files inside but keep
one folder (same name for all the folders) intact. Instead of going to
each folder to delete files manually, is there a way to batch that
process?

Thanks,
 
Reply With Quote
 
 
 
 
dadiOH
Guest
Posts: n/a
 
      9th Jun 2010

liu wrote:
> I have over 200 folders I need to delete all the files inside but keep
> one folder (same name for all the folders) intact. Instead of going to
> each folder to delete files manually, is there a way to batch that
> process?
>
> Thanks,


Search
Select all
De-select the one you want to keep
Delete

--

dadiOH
____________________________

dadiOH's dandies v3.06...
....a help file of info about MP3s, recording from
LP/cassette and tips & tricks on this and that.
Get it at http://mysite.verizon.net/xico



 
Reply With Quote
 
Bob I
Guest
Posts: n/a
 
      9th Jun 2010
use Xcopy /T /E to duplicate the empty directory structure then delete
the full one.

liu wrote:
> I have over 200 folders I need to delete all the files inside but keep
> one folder (same name for all the folders) intact. Instead of going to
> each folder to delete files manually, is there a way to batch that
> process?
>
> Thanks,


 
Reply With Quote
 
liu
Guest
Posts: n/a
 
      10th Jun 2010
On Jun 9, 3:07*pm, "dadiOH" <dad...@invalid.com> wrote:
> liu wrote:
> > I have over 200 folders I need to delete all the files inside but keep
> > one folder (same name for all the folders) intact. Instead of going to
> > each folder to delete files manually, is there a way to batch that
> > process?

>
> > Thanks,

>
> Search
> * * Select all
> * * * * De-select the one you want to keep
> * * * * * * Delete
>

That probably needs a lot of work. You would have to know every
filename inside the folder you don't want to delete or visually going
through the list.
 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a
 
      10th Jun 2010


"liu" <(E-Mail Removed)> wrote in message
news:503a80b8-5214-4cd1-bf69-(E-Mail Removed)...
> I have over 200 folders I need to delete all the files inside but keep
> one folder (same name for all the folders) intact. Instead of going to
> each folder to delete files manually, is there a way to batch that
> process?
>
> Thanks,


I'm sure it can be done with a simple batch file but I confess that I am not
clear about your requirements. Please elaborate with an example.

 
Reply With Quote
 
liu
Guest
Posts: n/a
 
      11th Jun 2010
> I'm sure it can be done with a simple batch file but I confess that I am not
> clear about your requirements. Please elaborate with an example.


Thank you very much for the offer to help. Here is what I have:
Multiple projects each one with a runtime (many HTML, ASP, images
etc), In each project there is a Source folder named "Source".
I'd like to delete the runtime while keep the Source folder intact.
There are many images, etc files in the Source folder too. Basically,
delete everything in root except "Source" folder and the content
inside.

Thanks,



 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a
 
      11th Jun 2010


"liu" <(E-Mail Removed)> wrote in message
news:a73eaee2-4e38-44cd-af32-(E-Mail Removed)...
>> I'm sure it can be done with a simple batch file but I confess that I am
>> not
>> clear about your requirements. Please elaborate with an example.

>
> Thank you very much for the offer to help. Here is what I have:
> Multiple projects each one with a runtime (many HTML, ASP, images
> etc), In each project there is a Source folder named "Source".
> I'd like to delete the runtime while keep the Source folder intact.
> There are many images, etc files in the Source folder too. Basically,
> delete everything in root except "Source" folder and the content
> inside.
>
> Thanks,


Your description is still rather general. Please quote a specific example of
what you wish to keep and what you wish to delete.

 
Reply With Quote
 
dadiOH
Guest
Posts: n/a
 
      11th Jun 2010
liu wrote:
> On Jun 9, 3:07 pm, "dadiOH" <dad...@invalid.com> wrote:
>> liu wrote:
>>> I have over 200 folders I need to delete all the files inside but
>>> keep one folder (same name for all the folders) intact. Instead of
>>> going to each folder to delete files manually, is there a way to
>>> batch that process?

>>
>>> Thanks,

>>
>> Search
>> Select all
>> De-select the one you want to keep
>> Delete
>>

> That probably needs a lot of work. You would have to know every
> filename inside the folder you don't want to delete or visually going
> through the list.


Why would you have to know the file names? ? You said you wanted to delete
*all* the files in all folders except those in one folder; you said nothing
about keeping *specific* files within a *specific* folder.

You need a better folder naming scheme.

--

dadiOH
____________________________

dadiOH's dandies v3.06...
....a help file of info about MP3s, recording from
LP/cassette and tips & tricks on this and that.
Get it at http://mysite.verizon.net/xico



 
Reply With Quote
 
dadiOH
Guest
Posts: n/a
 
      11th Jun 2010

liu wrote:
>> I'm sure it can be done with a simple batch file but I confess that
>> I am not clear about your requirements. Please elaborate with an
>> example.

>
> Thank you very much for the offer to help. Here is what I have:
> Multiple projects each one with a runtime (many HTML, ASP, images
> etc), In each project there is a Source folder named "Source".
> I'd like to delete the runtime while keep the Source folder intact.
> There are many images, etc files in the Source folder too. Basically,
> delete everything in root except "Source" folder and the content
> inside.


Ah, you want to keep *all* folders that have a given name, not just one
physical folder.

The only thing I can think of is to use a renaming program to batch rename
each "Source" folder to "Source1... Source2...etc". You could then use
Windows search to locate them, move all to a different location, then use
Windows search as I originally suggested on the root folder to delete what
was left in the project folders.


--

dadiOH
____________________________

dadiOH's dandies v3.06...
....a help file of info about MP3s, recording from
LP/cassette and tips & tricks on this and that.
Get it at http://mysite.verizon.net/xico



 
Reply With Quote
 
liu
Guest
Posts: n/a
 
      11th Jun 2010
> > Thank you very much for the offer to help. Here is what I have:
> > Multiple projects each one with a runtime (many HTML, ASP, images
> > etc), In each project there is a Source folder named "Source".
> > I'd like to delete the runtime while keep the Source folder intact.
> > There are many images, etc files in the Source folder too. Basically,
> > delete everything in root except "Source" folder and the content
> > inside.

>
> > Thanks,

>
> Your description is still rather general. Please quote a specific example of
> what you wish to keep and what you wish to delete.


project a
project a\file1.htm
project a\file2.htm
...
project a\file3.css
project a\file4.js
....
project a\images\file5.jpg
....
project a\Source\file6.fla
project a\Source\file7.fla
.....

I'd like to delete everything inside project a including folders
inside except Source folder. Keep everything inside the source folder
no matter what are inside.

project b
same structure but different files.

Do the same for the remaining 200 more projects with the same
structure.

Thanks for the help,
 
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 delete all files under a folder ad Microsoft C# .NET 3 23rd Aug 2006 12:09 PM
Can't delete a folder and files Andy Windows XP General 6 30th Oct 2005 12:29 PM
Cannot delete files from program files folder Katie Windows XP Performance 0 21st Dec 2003 04:52 PM
can't delete folder or files Tena Heffernan Microsoft Windows 2000 Security 1 23rd Oct 2003 02:12 AM
Delete All Files in Folder JasonP Microsoft VB .NET 2 26th Aug 2003 04:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 PM.