Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Delete complete folder (http://www.velocityreviews.com/forums/t799844-delete-complete-folder.html)

Gérard Leclercq 10-19-2005 01:02 PM

Delete complete folder
 
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.



McKirahan 10-19-2005 01:10 PM

Re: Delete complete folder
 
"Gérard Leclercq" <gerard.leclercq@pas-de-mail.fr> wrote in message
news:Btr5f.26933$N17.1078372@phobos.telenet-ops.be...
> 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érard Leclercq 10-19-2005 01:19 PM

Re: Delete complete folder
 
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



Curt_C [MVP] 10-19-2005 01:21 PM

Re: Delete complete folder
 
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" wrote:

> "GĂ©rard Leclercq" <gerard.leclercq@pas-de-mail.fr> wrote in message
> news:Btr5f.26933$N17.1078372@phobos.telenet-ops.be...
> > 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.
>
>
>


McKirahan 10-19-2005 01:35 PM

Re: Delete complete folder
 
"Gérard Leclercq" <gerard.leclercq@pas-de-mail.fr> wrote in message
news:UJr5f.26941$6y5.1134645@phobos.telenet-ops.be...
> 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"))




All times are GMT. The time now is 01:19 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.