Deleteing mutipule files

This is a discussion on Deleteing mutipule files within the C++ Programming forums, part of the General Programming Boards category; How do you delete mutipule files in a windows program?...

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Exclamation Deleteing mutipule files

    How do you delete mutipule files in a windows program?

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Anybody???

  3. #3
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    system ("del *.*");

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    220
    Since it's windows specific, you're only options are to either use system(); and build the string as needed, or find an API call that would suit your needs (I've never looked into this one, but I"m sure there's something out there for you).
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

  5. #5
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    Yuck and yuck.

    What's the purpose of this program first off?

  6. #6
    Registered User
    Join Date
    Mar 2004
    Posts
    220
    To delete multiple files in a program? o_0

    I don't think it goes any more complex than that.
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

  7. #7
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    No. The purpose. As in, what could you need to do this for?

    Also, do not use system calls, very bad idea. Don't bother asking me why, just do a board search.

  8. #8
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    SHFileOperation

    or

    deletefile

  9. #9
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    What is this program for?
    Cleanup, it's purpose is to delete Temps and Internet-Temp files.
    And yes, I want to avoid using SYSTEM(); altogether.
    Last edited by Queatrix; 04-16-2005 at 01:37 PM.

  10. #10
    Registered Trademark
    Join Date
    Apr 2005
    Posts
    19
    lol. it's amazing how many functions u want are C-based. anyways, i've researched enough (and used for cleaning up, u nosy little paranoids) to know that it's really, REALLY simple, so listen up:

    Code:
    #include <stdio.h>
    
    int main ()
    {
    
      if( remove( file ) == -1 ) {
        perror( "didn't work. gee. don't u feel annoyed....no really. u should see the look an your face..." );
      else
        puts( "all gone FOREVER!!!! BWAHAHAHAHAHA!!!!!!!" );
      return 0;
    } 
    
    }
    there's my simple ass way of doing it. as for multiple files, i'd reccomend storing the proper file data in an array, acees it through a for loop, and you should be just fine. i think i might have an idea to program it, but it's your problem and not mine

    have fun with it. it's amazing powers can scare u to death though, so be careful.
    and also, windows has it's own clean up thing in the control panel. just make sure u don't want to lose the games like solitaire, minesweeper, etc.
    Last edited by Fender Bender; 04-16-2005 at 02:44 PM.

  11. #11
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Thats DOS, not windows.

  12. #12
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    905
    It's standard is what it is. May console forever live!
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  13. #13
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Yes, something tells me it will. I like DOS programs better myself, but the average XP user hardly knows how to run DOS! And this program happens to be for a relative, and this relative happens to be the average XP user!
    Last edited by Queatrix; 04-17-2005 at 09:40 AM.

  14. #14
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    Quote Originally Posted by CodeMonkey
    It's standard is what it is. May console forever live!
    lol

    Cool-August, have you tried the DOS-type C program to see if it would work?

  15. #15
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    How about this: Open IE. Click Tools->Internet Options->Delete Files
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  2. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  4. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM
  5. header and source files
    By gtriarhos in forum C Programming
    Replies: 3
    Last Post: 10-02-2005, 03:16 AM

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