Clear An Entire Folder

This is a discussion on Clear An Entire Folder within the C++ Programming forums, part of the General Programming Boards category; How can I delete all of the files in a folder?...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    59

    Clear An Entire Folder

    How can I delete all of the files in a folder?

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    1) Select the directory (in explorer)
    2) Click with the left mouse button once on the first file.
    3) Scroll down to the last file.
    4) Press and hold Shift.
    5) Click with the left mouse button on the last file (while Shift is down).
    6) Press Delete (while Shift is down).
    7) Press Enter when the pop-up window appears.
    8) Done.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    59

    I meant with a c++ function

    I meant how would I do that with a C++ funtion in a program.

  4. #4
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    If we told you... you may want to send the executable to an enemy and erase his/her system files... so why should we tell you?


    >>>It is by will alone I set my mind in motion!
    -Dune

    Damn mentats....
    Blue

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    59

    Not to hurt anyone...

    I am not asking because I want to write a virus or something of that nature. I would like to write a program that clears temporary internet files(c:\windows\temporary internet files), temp files(c:\windows\temp) upon boot. Maybe I can add the ability to search a hardrive for temp files (.tmp, .bak...).

    I have no interest in hariming anyone else's computer. If you don't feel comfertable telling me so be it.

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    im very trusting so ill help.
    Code:
    system("erase C:\windows\temp -y");
    system("erase C:\windows\tempor~1 -y");
    the include file is process.h

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. How do I clear the history folder?
    By Queatrix in forum Windows Programming
    Replies: 0
    Last Post: 08-20-2005, 09:13 AM
  3. Hiding a folder
    By nextstep in forum Windows Programming
    Replies: 16
    Last Post: 03-20-2005, 02:07 PM
  4. Using a button to clear a list box!
    By Unregistered in forum C++ Programming
    Replies: 13
    Last Post: 08-23-2002, 07:44 PM
  5. Replies: 12
    Last Post: 01-23-2002, 06:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21