PC Review


Reply
Thread Tools Rate Thread

DELTREE equivalent

 
 
Andrew Aronoff
Guest
Posts: n/a
 
      29th Sep 2005
I'm looking for a replacement for DELTREE.EXE under W2K. I've read in
various Usenet posts that RD and/or DEL can be used, but I haven't
found this to be true in my tests.

I'm looking for a command to replace the following:

DELTREE /Y C:\TEMP\

This single command deletes the entire contents of the directory
C:\TEMP (including subdirectories and their contents) _without_
deleting the directory itself.

RD /Q /S C:\TEMP deletes the TEMP directory, too.

Is there a closer fit? (If not, I'll stick with DELTREE, which works
perfectly well in a CMD.EXE shell under W2K and WXP.)

regards, Andy
--
**********

Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com

To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org

**********
 
Reply With Quote
 
 
 
 
NayJo
Guest
Posts: n/a
 
      29th Sep 2005
rd /s

see rd /?

J


"Andrew Aronoff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm looking for a replacement for DELTREE.EXE under W2K. I've read in
> various Usenet posts that RD and/or DEL can be used, but I haven't
> found this to be true in my tests.
>
> I'm looking for a command to replace the following:
>
> DELTREE /Y C:\TEMP\
>
> This single command deletes the entire contents of the directory
> C:\TEMP (including subdirectories and their contents) _without_
> deleting the directory itself.
>
> RD /Q /S C:\TEMP deletes the TEMP directory, too.
>
> Is there a closer fit? (If not, I'll stick with DELTREE, which works
> perfectly well in a CMD.EXE shell under W2K and WXP.)
>
> regards, Andy
> --
> **********
>
> Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com
>
> To identify everything that starts up with Windows, download
> "Silent Runners.vbs" at www.silentrunners.org
>
> **********



 
Reply With Quote
 
NayJo
Guest
Posts: n/a
 
      29th Sep 2005
Apologies Andrew, I should have read further....

J


"NayJo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> rd /s
>
> see rd /?
>
> J
>
>
> "Andrew Aronoff" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I'm looking for a replacement for DELTREE.EXE under W2K. I've read in
> > various Usenet posts that RD and/or DEL can be used, but I haven't
> > found this to be true in my tests.
> >
> > I'm looking for a command to replace the following:
> >
> > DELTREE /Y C:\TEMP\
> >
> > This single command deletes the entire contents of the directory
> > C:\TEMP (including subdirectories and their contents) _without_
> > deleting the directory itself.
> >
> > RD /Q /S C:\TEMP deletes the TEMP directory, too.
> >
> > Is there a closer fit? (If not, I'll stick with DELTREE, which works
> > perfectly well in a CMD.EXE shell under W2K and WXP.)
> >
> > regards, Andy
> > --
> > **********
> >
> > Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com
> >
> > To identify everything that starts up with Windows, download
> > "Silent Runners.vbs" at www.silentrunners.org
> >
> > **********

>
>



 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      29th Sep 2005
In microsoft.public.win2000.cmdprompt.admin Andrew Aronoff wrote:

> I'm looking for a replacement for DELTREE.EXE under W2K. I've
> read in various Usenet posts that RD and/or DEL can be used, but
> I haven't found this to be true in my tests.
>
> I'm looking for a command to replace the following:
>
> DELTREE /Y C:\TEMP\
>
> This single command deletes the entire contents of the directory
> C:\TEMP (including subdirectories and their contents) _without_
> deleting the directory itself.
>
> RD /Q /S C:\TEMP deletes the TEMP directory, too.


Run that from *within* the c:\temp\ location.

> Is there a closer fit? (If not, I'll stick with DELTREE, which
> works perfectly well in a CMD.EXE shell under W2K and WXP.)
>
> regards, Andy


 
Reply With Quote
 
R Harrison
Guest
Posts: n/a
 
      29th Sep 2005
You could scrip it so that you do the RD function, which will delete the
entire structure as you mentioned, then do an MD Temp to recreate it again.

The only way to remove all directories in C:\Temp is to RD them 1 at a time,
because RD does remove the root directory in the command.

Suggested bacth file
*************************
c:
cd\
RD /S /Q C:\Temp
md temp
*************************



"Andrew Aronoff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm looking for a replacement for DELTREE.EXE under W2K. I've read in
> various Usenet posts that RD and/or DEL can be used, but I haven't
> found this to be true in my tests.
>
> I'm looking for a command to replace the following:
>
> DELTREE /Y C:\TEMP\
>
> This single command deletes the entire contents of the directory
> C:\TEMP (including subdirectories and their contents) _without_
> deleting the directory itself.
>
> RD /Q /S C:\TEMP deletes the TEMP directory, too.
>
> Is there a closer fit? (If not, I'll stick with DELTREE, which works
> perfectly well in a CMD.EXE shell under W2K and WXP.)
>
> regards, Andy
> --
> **********
>
> Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com
>
> To identify everything that starts up with Windows, download
> "Silent Runners.vbs" at www.silentrunners.org
>
> **********



 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      29th Sep 2005
In microsoft.public.win2000.cmdprompt.admin R Harrison wrote:

> You could scrip it so that you do the RD function, which will
> delete the entire structure as you mentioned, then do an MD Temp
> to recreate it again.
>
> The only way to remove all directories in C:\Temp is to RD them
> 1 at a time, because RD does remove the root directory in the
> command.


Not if you are "in" it.

>
> Suggested bacth file
> *************************
> c:
> cd\
> RD /S /Q C:\Temp
> md temp
> *************************
>
>
>
> "Andrew Aronoff" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> I'm looking for a replacement for DELTREE.EXE under W2K. I've
>> read in various Usenet posts that RD and/or DEL can be used,
>> but I haven't found this to be true in my tests.
>>
>> I'm looking for a command to replace the following:
>>
>> DELTREE /Y C:\TEMP\
>>
>> This single command deletes the entire contents of the
>> directory C:\TEMP (including subdirectories and their contents)
>> _without_ deleting the directory itself.
>>
>> RD /Q /S C:\TEMP deletes the TEMP directory, too.
>>
>> Is there a closer fit? (If not, I'll stick with DELTREE, which
>> works perfectly well in a CMD.EXE shell under W2K and WXP.)
>>
>> regards, Andy
>> --
>> **********
>>
>> Please send e-mail to: usenet (dot) post (at) aaronoff
>> (dot) com
>>
>> To identify everything that starts up with Windows,
>> download
>> "Silent Runners.vbs" at www.silentrunners.org
>>
>> **********

>
>
>


 
Reply With Quote
 
billious
Guest
Posts: n/a
 
      29th Sep 2005

"Andrew Aronoff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm looking for a replacement for DELTREE.EXE under W2K. I've read in
> various Usenet posts that RD and/or DEL can be used, but I haven't
> found this to be true in my tests.
>
> I'm looking for a command to replace the following:
>
> DELTREE /Y C:\TEMP\
>
> This single command deletes the entire contents of the directory
> C:\TEMP (including subdirectories and their contents) _without_
> deleting the directory itself.
>
> RD /Q /S C:\TEMP deletes the TEMP directory, too.
>
> Is there a closer fit? (If not, I'll stick with DELTREE, which works
> perfectly well in a CMD.EXE shell under W2K and WXP.)
>
> regards, Andy
> --



How about (as a batch file, obviously)

xcopy /t /e c:\temp c:\somejunkname\
rd /q/s c:\temp
ren c:\somejunkname temp

You could possibly build somejunkname (just in case somejunkname might
already exist) using something like

set yjn=x
:loop
if exist c:\%yjn%* set yjn=%yjn%q&goto loop

which should set %yjn% (Your Junk Name) to "x" followed by as many "q"s as
are required to make the string unique. use %yjn% in place of somejunkname
in the above, clean up yjn using

set yjn=

to remove yjn from the environment, and job done.

HTH

....Bill



 
Reply With Quote
 
Andrew Aronoff
Guest
Posts: n/a
 
      29th Sep 2005
>> RD /Q /S C:\TEMP deletes the TEMP directory, too.
>
>Run that from *within* the c:\temp\ location.


Thanks. Didn't know that. That's certainly a very close fit.

regards, Andy
--
**********

Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com

To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org

**********
 
Reply With Quote
 
Andrew Aronoff
Guest
Posts: n/a
 
      29th Sep 2005
>> RD /Q /S C:\TEMP deletes the TEMP directory, too.
>
>Run that from *within* the c:\temp\ location.


Oops! I tried it out and it does what's needed, but it throws the
error, "The process cannot access the file because it is being used by
another process." Do you know of any way around that?

regards, Andy
--
**********

Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com

To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org

**********
 
Reply With Quote
 
Andrew Aronoff
Guest
Posts: n/a
 
      29th Sep 2005
>How about (as a batch file, obviously)
>
>xcopy /t /e c:\temp c:\somejunkname\
>rd /q/s c:\temp
>ren c:\somejunkname temp


Thanks for the suggestion. I think the /e parameter is best omitted
since it copies the subdirectories, which DELTREE would have deleted.

IAC, I think I'll stick with DELTREE, which is simpler to deploy and
run.

regards, Andy
--
**********

Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com

To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org

**********
 
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
Deltree boe Windows XP General 6 31st May 2007 03:26 AM
DELTREE Eric Windows XP General 7 21st Dec 2005 08:39 PM
Equivalent DELTREE /Y *.* command in XP? =?Utf-8?B?RGFuIFAu?= Windows XP Help 5 8th Jun 2004 09:11 PM
deltree mhd Windows XP General 2 7th Jan 2004 10:41 AM
DELTREE Arpan Microsoft Windows 2000 7 12th Nov 2003 11:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:21 PM.