DELETING FILES - DEL COMMAND

G

Guest

Hi, i am using the DEL command (IN WINDOWS XP COMMAND PROMPT), and i am
trying to delete all the files in a certain folder.

The command did work, but it did NOT delete the folders within that
particular folder.

I did specify DEL /Q /S C:\"Documents and Settings\Rafik\Local
Settings\Temp\*.*" So how do i delete the folders within this folder? - as
they remain there. what can i add to the command to achieve the deletion of
all folders within TEMP.

I want to learn the using commands etc, which is the reason i am trying to
do this.

Can anyone help.

regards
 
T

Terry

On 12/31/2004 1:17 PM On a whim, Pinto1uk pounded out on the keyboard
Hi, i am using the DEL command (IN WINDOWS XP COMMAND PROMPT), and i am
trying to delete all the files in a certain folder.

The command did work, but it did NOT delete the folders within that
particular folder.

I did specify DEL /Q /S C:\"Documents and Settings\Rafik\Local
Settings\Temp\*.*" So how do i delete the folders within this folder? - as
they remain there. what can i add to the command to achieve the deletion of
all folders within TEMP.

I want to learn the using commands etc, which is the reason i am trying to
do this.

Can anyone help.

regards

It worked as it was designed. Even though DEL was changed since Win9x, I
don't understand why it leaves empty folders either, it's like the
programmers didn't finish what they started. For a while I had a batch
using RD to remove all directories but it's silly to use 2 commands when
one will work.

I always copy DELTREE over from Win9x and use it on client machines. It
will remove the files and the folders by putting a backslash at the end;
deltree /y c:\temp\


--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
G

GTS

The equivalent to the Win 9X deltree in XP is rmdir /S
/Q can optionally be added for no confirmation prompt.
 
L

lforbes

GTS said:
The equivalent to the Win 9X deltree in XP is rmdir /S
/Q can optionally be added for no confirmation prompt.

Hi,

I ran into this problem as well. I found that the "rmdir /s" worked
far better. It removed the directory and all subdirectories and files.

Cheers,

Lara
 
M

Mikhail Zhilin

Last day you asked this question in at least 10 threads. I answered in
one of them.
--
Mikhail Zhilin
http://www.aha.ru/~mwz
Sorry, no technical support by e-mail.
Please reply to the newsgroups only.
======
 
T

Terry

On 12/31/2004 2:53 PM On a whim, GTS pounded out on the keyboard
The equivalent to the Win 9X deltree in XP is rmdir /S
/Q can optionally be added for no confirmation prompt.

Not really. Using deltree: deltree /y c:\temp\
will remove all files and folders in c:\temp without removing the temp
folder itself.

Using rmdir /s /q c:\temp\ removes all files and folders within c:\temp
and ALSO removes the folder c:\temp, causing you to have to recreate the
temp folder.


--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
T

Terry

The equivalent to the Win 9X deltree in XP is rmdir /S
/Q can optionally be added for no confirmation prompt.

Hi,

I ran into this problem as well. I found that the "rmdir /s" worked
far better. It removed the directory and all subdirectories and files.

Cheers,

Lara
[/QUOTE]

Usually one doesn't want to remove the parent folder but only remove all
of the contents. RMDIR removes the parent folder also and then it must
be recreated. To remove your temp files you would need two lines
rmdir /s /q c:\temp\
md c:\temp

whereas using deltree you can remove everything without having to
re-create the file:
deltree /y c:\temp\

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
L

lforbes

Hi,
whereas using deltree you can remove everything without having to
re-create the file: deltree /y c:\temp\

Unfortunately deltree is not a program available on Windows XP. I am
not sure if you can download it, but I haven’t been able to find it. I
don’t use Win 9x and haven’t for years.

Cheers,

Lara
 
A

Alex Nichol

lforbes said:
Unfortunately deltree is not a program available on Windows XP. I am
not sure if you can download it, but I haven’t been able to find it. I
don’t use Win 9x and haven’t for years.

XP has introduced an /S switch in DEL that gives the same effect -
deleting sub-folders and content
 
T

Terry

On 12/31/2004 11:41 PM On a whim, lforbes pounded out on the keyboard
Hi,


Unfortunately deltree is not a program available on Windows XP. I am
not sure if you can download it, but I haven’t been able to find it. I
don’t use Win 9x and haven’t for years.

Cheers,

Lara

It's easily found doing a Google search. I carry around a floppy & CD
with it because I use it on all client machines.

I was just using DELTREE as an example of how DEL & RMDIR do not work as
well as DELTREE did. And it works fine on nt/w2k/xp.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
T

Terry

Unfortunately deltree is not a program available on Windows XP. I am
not sure if you can download it, but I haven’t been able to find it. I
don’t use Win 9x and haven’t for years.


XP has introduced an /S switch in DEL that gives the same effect -
deleting sub-folders and content
[/QUOTE]

Try a test. It doesn't remove the sub-folders.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
T

Terry

Unfortunately deltree is not a program available on Windows XP. I am
not sure if you can download it, but I haven’t been able to find it. I
don’t use Win 9x and haven’t for years.


XP has introduced an /S switch in DEL that gives the same effect -
deleting sub-folders and content
[/QUOTE]

Only deletes files within the subfolders, not the subfolders.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
T

Terry

Try a test. It doesn't remove the sub-folders.


If you start at the top with DEL /S *.* then it ought to have the
subfolders in its list
[/QUOTE]

It will remove any files in all sub-folders, but not the sub-folders
themselves. Kind of cornball if you ask me.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
B

Bob I

Use RD /S for directory and file removal
Use del /S for file in directory removal leaving the tree intact.

If "DEL" did the SAME as RD then THAT would be cornball!

Terry wrote:
 
T

Terry

On 1/4/2005 8:37 AM On a whim, Bob I pounded out on the keyboard
Use RD /S for directory and file removal
Use del /S for file in directory removal leaving the tree intact.

If "DEL" did the SAME as RD then THAT would be cornball!

Terry wrote:

RD /s c:\temp\ removes all sub-folders AND the temp folder. This isn't
what a user usually wants to do when cleaning out a temp folder. Sure
you can use two steps;
RD /s c:\temp\
MD c:\temp
but THAT is cornball also.

DEL /s c:\temp\*.* removes all files within the temp folder AND all
files within any sub-folders. Leaving the sub-folders isn't usually what
someone wants to do when deleting using *.*.

ONE of those two utilities should give us the same functionality of DELTREE.

DELTREE /y c:\temp\ removes all files within temp, removes all
sub-folders within temp along with any files contained in those folders
but does NOT remove the temp folder.

What IS cornball is that MS would not include DELTREE any longer, add
attributes to DEL that people think do the same thing that DELTREE did.

Any questions?


--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top