Delete complete folder

G

Gérard Leclercq

Can't find exemple. How can i delete a complete folder including subfolders
and files in the subfolders. Or do i to delete one by one ?

Gérard.
 
M

McKirahan

Gérard Leclercq said:
Can't find exemple. How can i delete a complete folder including subfolders
and files in the subfolders. Or do i to delete one by one ?

Gérard.

If using the Command Prompt is an option then use DELTREE.


C:\>deltree /?
Deletes a directory and all the subdirectories and files in it.

To delete one or more files and directories:
DELTREE [/Y] [drive:]path [[drive:]path[...]]

/Y Suppresses prompting to confirm you want to delete
the subdirectory.
[drive:]path Specifies the name of the directory you want to delete.

Note: Use DELTREE cautiously. Every file and subdirectory within the
specified directory will be deleted.
 
G

Gérard Leclercq

This is an ASP group i suppose, not a DOS group. So i suppose an ASP exemple
on how to delete a complete folder including all underlaying folders and
files.
Gérard
 
C

Curt_C [MVP]

deltree isn't on all OS's

"del" will work, look at the /s option

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com



McKirahan said:
Gérard Leclercq said:
Can't find exemple. How can i delete a complete folder including subfolders
and files in the subfolders. Or do i to delete one by one ?

Gérard.

If using the Command Prompt is an option then use DELTREE.


C:\>deltree /?
Deletes a directory and all the subdirectories and files in it.

To delete one or more files and directories:
DELTREE [/Y] [drive:]path [[drive:]path[...]]

/Y Suppresses prompting to confirm you want to delete
the subdirectory.
[drive:]path Specifies the name of the directory you want to delete.

Note: Use DELTREE cautiously. Every file and subdirectory within the
specified directory will be deleted.
 
M

McKirahan

Gérard Leclercq said:
This is an ASP group i suppose, not a DOS group. So i suppose an ASP exemple
on how to delete a complete folder including all underlaying folders and
files.
Gérard


Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder(Server.MapPath("\Temp"))
Set objFSO = Nothing

Or

Server.CreateObject("Scripting.FileSystemObject").DeleteFolder(Server.MapPat
h("\Temp"))
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top