Delete complete folder

Discussion in 'ASP General' started by Gérard Leclercq, Oct 19, 2005.

  1. 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.
    Gérard Leclercq, Oct 19, 2005
    #1
    1. Advertising

  2. Gérard Leclercq

    McKirahan Guest

    "Gérard Leclercq" <> wrote in message
    news:Btr5f.26933$-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, Oct 19, 2005
    #2
    1. Advertising

  3. 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
    Gérard Leclercq, Oct 19, 2005
    #3
  4. Gérard Leclercq

    Curt_C [MVP] Guest

    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" <> wrote in message
    > news:Btr5f.26933$-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.
    >
    >
    >
    Curt_C [MVP], Oct 19, 2005
    #4
  5. Gérard Leclercq

    McKirahan Guest

    "Gérard Leclercq" <> wrote in message
    news:UJr5f.26941$-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"))
    McKirahan, Oct 19, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    3
    Views:
    2,928
    Alvin Bruney
    Oct 16, 2003
  2. William LaMartin

    _vti_cnf folder in the bin folder-- a problem?

    William LaMartin, Nov 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,691
    Oliver
    Nov 10, 2003
  3. Dan
    Replies:
    7
    Views:
    18,552
    catherine sea
    Oct 28, 2010
  4. Jon Maz
    Replies:
    12
    Views:
    4,741
    Vadim Chekan
    Jul 1, 2004
  5. madhu
    Replies:
    0
    Views:
    416
    madhu
    Oct 5, 2006
Loading...

Share This Page