A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Delete all files except one folder



 
 
Thread Tools Display Modes
  #31  
Old June 16th 10, 04:03 PM posted to microsoft.public.windowsxp.general
surferdude2[_2_]
external usenet poster
 
Posts: 2
Default Delete all files except one folder


Consider using the freeware 'XXCOPY'
(http://www.xxcopy.com/xcpymain.htm) to do that job.

I created a structure similar to what you described and did a quick
batch file. It seems to do what you want:


Code:
--------------------
xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
xxcopy /clone /yy F:\projectsxxcopy F:\projects\
RD F:\projectsxxcopy /s /q
--------------------


Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


Ads
  #32  
Old June 16th 10, 04:03 PM posted to microsoft.public.windowsxp.general
surferdude2[_2_]
external usenet poster
 
Posts: 2
Default Delete all files except one folder


Consider using the freeware 'XXCOPY'
(http://www.xxcopy.com/xcpymain.htm) to do that job.

I created a structure similar to what you described and did a quick
batch file. It seems to do what you want:


Code:
--------------------
xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
xxcopy /clone /yy F:\projectsxxcopy F:\projects\
RD F:\projectsxxcopy /s /q
--------------------


Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


  #33  
Old June 16th 10, 04:15 PM posted to microsoft.public.windowsxp.general
surferdude2[_3_]
external usenet poster
 
Posts: 2
Default Delete all files except one folder


Here's how it worked:

BEFO

Code:
--------------------
F:\projectstree /f
Folder PATH listing for volume f10gig D2P1
Volume serial number is 0006EE44 E48B:68F4
F:.
¦ deleteme.txt
¦
+---Project001
¦ ¦ deleteme.txt
¦ ¦
¦ +---Source
¦ keepme.txt
¦
+---project002
¦ ¦ deleteme.txt
¦ ¦
¦ +---source
¦ keepme.txt
¦
+---Project111
¦ ¦ deleteme.txt
¦ ¦
¦ +---Source
¦ keepme.txt
¦
+---project222
¦ ¦ deleteme.txt
¦ ¦
¦ +---Source
¦ keepme.txt
¦
+---project999
¦ deleteme.txt
¦
+---source
keepme.txt
--------------------


AFTER:

Code:
--------------------
F:\projectstree /f
Folder PATH listing for volume f10gig D2P1
Volume serial number is 0006EE44 E48B:68F4
F:.
+---Project001
¦ +---Source
¦ keepme.txt
¦
+---project002
¦ +---source
¦ keepme.txt
¦
+---Project111
¦ +---Source
¦ keepme.txt
¦
+---project222
¦ +---Source
¦ keepme.txt
¦
+---project999
+---source
keepme.txt
--------------------


Does that look like what you are trying to achieve?


  #34  
Old June 16th 10, 04:15 PM posted to microsoft.public.windowsxp.general
surferdude2[_3_]
external usenet poster
 
Posts: 2
Default Delete all files except one folder


Here's how it worked:

BEFO

Code:
--------------------
F:\projectstree /f
Folder PATH listing for volume f10gig D2P1
Volume serial number is 0006EE44 E48B:68F4
F:.
¦ deleteme.txt
¦
+---Project001
¦ ¦ deleteme.txt
¦ ¦
¦ +---Source
¦ keepme.txt
¦
+---project002
¦ ¦ deleteme.txt
¦ ¦
¦ +---source
¦ keepme.txt
¦
+---Project111
¦ ¦ deleteme.txt
¦ ¦
¦ +---Source
¦ keepme.txt
¦
+---project222
¦ ¦ deleteme.txt
¦ ¦
¦ +---Source
¦ keepme.txt
¦
+---project999
¦ deleteme.txt
¦
+---source
keepme.txt
--------------------


AFTER:

Code:
--------------------
F:\projectstree /f
Folder PATH listing for volume f10gig D2P1
Volume serial number is 0006EE44 E48B:68F4
F:.
+---Project001
¦ +---Source
¦ keepme.txt
¦
+---project002
¦ +---source
¦ keepme.txt
¦
+---Project111
¦ +---Source
¦ keepme.txt
¦
+---project222
¦ +---Source
¦ keepme.txt
¦
+---project999
+---source
keepme.txt
--------------------


Does that look like what you are trying to achieve?


  #35  
Old June 16th 10, 08:30 PM posted to microsoft.public.windowsxp.general
Anthony Buckland
external usenet poster
 
Posts: 526
Default Delete all files except one folder

I'm chiming in at the end of what I imagine is
an extended conversation, but:

If the object is just what the subject line says, to
delete all of a large body of files except for one
folder in that body, then make the chosen folder
hidden, and make sure hidden files are not shown.
Then any deletion of the body as a whole will
leave the one hidden folder in existence, after
which it can be un-hidden whenever that becomes
desirable.

Or am I missing the point of the discussion?


  #36  
Old June 16th 10, 08:30 PM posted to microsoft.public.windowsxp.general
Anthony Buckland
external usenet poster
 
Posts: 526
Default Delete all files except one folder

I'm chiming in at the end of what I imagine is
an extended conversation, but:

If the object is just what the subject line says, to
delete all of a large body of files except for one
folder in that body, then make the chosen folder
hidden, and make sure hidden files are not shown.
Then any deletion of the body as a whole will
leave the one hidden folder in existence, after
which it can be un-hidden whenever that becomes
desirable.

Or am I missing the point of the discussion?


  #37  
Old June 16th 10, 08:58 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Delete all files except one folder



"Anthony Buckland" wrote in message
news
I'm chiming in at the end of what I imagine is
an extended conversation, but:

If the object is just what the subject line says, to
delete all of a large body of files except for one
folder in that body, then make the chosen folder
hidden, and make sure hidden files are not shown.
Then any deletion of the body as a whole will
leave the one hidden folder in existence, after
which it can be un-hidden whenever that becomes
desirable.

Or am I missing the point of the discussion?


No, you're not and I love this bit of lateral thinking!

  #38  
Old June 16th 10, 08:58 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Delete all files except one folder



"Anthony Buckland" wrote in message
news
I'm chiming in at the end of what I imagine is
an extended conversation, but:

If the object is just what the subject line says, to
delete all of a large body of files except for one
folder in that body, then make the chosen folder
hidden, and make sure hidden files are not shown.
Then any deletion of the body as a whole will
leave the one hidden folder in existence, after
which it can be un-hidden whenever that becomes
desirable.

Or am I missing the point of the discussion?


No, you're not and I love this bit of lateral thinking!

  #39  
Old June 17th 10, 07:15 PM posted to microsoft.public.windowsxp.general
liu
external usenet poster
 
Posts: 50
Default Delete all files except one folder

--------------------
* * xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
* xxcopy /clone /yy F:\projectsxxcopy F:\projects\
* RD F:\projectsxxcopy /s /q
--------------------

Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


It worked. THANKS A LOT!!!
  #40  
Old June 17th 10, 07:15 PM posted to microsoft.public.windowsxp.general
liu
external usenet poster
 
Posts: 50
Default Delete all files except one folder

--------------------
* * xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
* xxcopy /clone /yy F:\projectsxxcopy F:\projects\
* RD F:\projectsxxcopy /s /q
--------------------

Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


It worked. THANKS A LOT!!!
  #41  
Old June 18th 10, 10:42 AM posted to microsoft.public.windowsxp.general
T Shadow[_2_]
external usenet poster
 
Posts: 83
Default Delete all files except one folder

"surferdude2" wrote in message
...

Consider using the freeware 'XXCOPY'
(http://www.xxcopy.com/xcpymain.htm) to do that job.

I created a structure similar to what you described and did a quick
batch file. It seems to do what you want:


Code:
--------------------
xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
xxcopy /clone /yy F:\projectsxxcopy F:\projects\
RD F:\projectsxxcopy /s /q
--------------------


Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


I think shools should test students for criminal apptiude so they know they
aren't cut out for it and can lead more productive lives. Doubtful time in a
correctional facility will cure you and the citizens will be paying for your
keep the rest of your life. Wasting other peoples lives too, your family
included. I'd say 240grains of lead is the only thing to cure the two of
you. Don't really care if that's not what the two of you are doing.
Spreading this kind of crap makes you guilty too.

http://www.missingkids.com/

Anyone still wondering why newsgroups are going away.


  #42  
Old June 18th 10, 10:42 AM posted to microsoft.public.windowsxp.general
T Shadow[_2_]
external usenet poster
 
Posts: 83
Default Delete all files except one folder

"surferdude2" wrote in message
...

Consider using the freeware 'XXCOPY'
(http://www.xxcopy.com/xcpymain.htm) to do that job.

I created a structure similar to what you described and did a quick
batch file. It seems to do what you want:


Code:
--------------------
xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
xxcopy /clone /yy F:\projectsxxcopy F:\projects\
RD F:\projectsxxcopy /s /q
--------------------


Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


I think shools should test students for criminal apptiude so they know they
aren't cut out for it and can lead more productive lives. Doubtful time in a
correctional facility will cure you and the citizens will be paying for your
keep the rest of your life. Wasting other peoples lives too, your family
included. I'd say 240grains of lead is the only thing to cure the two of
you. Don't really care if that's not what the two of you are doing.
Spreading this kind of crap makes you guilty too.

http://www.missingkids.com/

Anyone still wondering why newsgroups are going away.


  #43  
Old June 18th 10, 12:14 PM posted to microsoft.public.windowsxp.general
Jim[_45_]
external usenet poster
 
Posts: 203
Default Delete all files except one folder

On Fri, 18 Jun 2010 05:42:45 -0400, "T Shadow" wrote:

"surferdude2" wrote in message
...

Consider using the freeware 'XXCOPY'
(http://www.xxcopy.com/xcpymain.htm) to do that job.

I created a structure similar to what you described and did a quick
batch file. It seems to do what you want:


Code:
--------------------
xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
xxcopy /clone /yy F:\projectsxxcopy F:\projects\
RD F:\projectsxxcopy /s /q
--------------------


Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


I think shools should test students for criminal apptiude so they know they
aren't cut out for it and can lead more productive lives. Doubtful time in a
correctional facility will cure you and the citizens will be paying for your
keep the rest of your life. Wasting other peoples lives too, your family
included. I'd say 240grains of lead is the only thing to cure the two of
you. Don't really care if that's not what the two of you are doing.
Spreading this kind of crap makes you guilty too.

http://www.missingkids.com/

Anyone still wondering why newsgroups are going away.



WindowsXP ???????????????????????????
  #44  
Old June 18th 10, 12:14 PM posted to microsoft.public.windowsxp.general
Jim[_45_]
external usenet poster
 
Posts: 203
Default Delete all files except one folder

On Fri, 18 Jun 2010 05:42:45 -0400, "T Shadow" wrote:

"surferdude2" wrote in message
...

Consider using the freeware 'XXCOPY'
(http://www.xxcopy.com/xcpymain.htm) to do that job.

I created a structure similar to what you described and did a quick
batch file. It seems to do what you want:


Code:
--------------------
xxcopy /clone /yy F:\projects\project???\source\*.* F:\projectsxxcopy
xxcopy /clone /yy F:\projectsxxcopy F:\projects\
RD F:\projectsxxcopy /s /q
--------------------


Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


I think shools should test students for criminal apptiude so they know they
aren't cut out for it and can lead more productive lives. Doubtful time in a
correctional facility will cure you and the citizens will be paying for your
keep the rest of your life. Wasting other peoples lives too, your family
included. I'd say 240grains of lead is the only thing to cure the two of
you. Don't really care if that's not what the two of you are doing.
Spreading this kind of crap makes you guilty too.

http://www.missingkids.com/

Anyone still wondering why newsgroups are going away.



WindowsXP ???????????????????????????
  #45  
Old June 18th 10, 01:40 PM posted to microsoft.public.windowsxp.general
surferdude2[_4_]
external usenet poster
 
Posts: 2
Default Delete all files except one folder


liu;1222390 Wrote:
--------------------
* * xxcopy /clone /yy F:\projects\project???\source\*.*

F:\projectsxxcopy
* xxcopy /clone /yy F:\projectsxxcopy F:\projects\
* RD F:\projectsxxcopy /s /q
--------------------

Use quotes if you have embedded spaces in your path.

It simply copies all project folders to an intermediate folder and

then
clones that folder back to the original, thus deleting all files and
folders except those named projects and source.

xxcopy is a great time saver for situations like yours.


It worked. THANKS A LOT!!!


XXCOPY is a powerful tool - use it with caution! It is extremely
important to always include a target folder other than the root folder
when using the /clone switch, especially if including the /yy switch
which prevents any confirmation prompts. Cloning to a target root
folder will wipe all data from the target folder and replace it with the
source data. That's not what is usually desired, to say the least.

All the best,

Dude


 




Thread Tools
Display Modes

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

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






All times are GMT +1. The time now is 08:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.