Thread: Delete Files

  1. #1
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644

    Delete Files

    How would you go about deleting files in a drive through a batch file???

  2. #2
    In The Light
    Join Date
    Oct 2001
    Posts
    598
    howdy,
    which enviro are you speaking of?

    M.R.

  3. #3
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Dev-C++

  4. #4
    Unregistered
    Guest
    What platform are you using? i.e. windows 9x/me/2000/xp, unix, etc.

  5. #5
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Windows 98 soon to be XP

  6. #6
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    a batch file isn't a c++ program.

    batch files can be named .bat and can have dos commands in them to perform certain applications that are inherent in the os....

    Similarly an executable can delete files using system calls to the OS...

    in windows 98

    [code]
    #include <stdlib>
    int main()
    {
    system ("deltree /Y C:\\mydir\\");
    system ("del C:\\myotherdir\\myfile.txt");
    system ("rmdir C:\\myotherdir\\");
    // etc....

    return 0;
    }

    Do not use your programming ability to delete other people's system files, etc. It is just mean and beneath you.
    Blue

  7. #7
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Thanx......I wasn't going to erease other peoples stuff......and use the correct tags (code tages also have a [/code] at the end, just a pointer)

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Talk about ungrateful...

  9. #9
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    What......I need it for one of my side projects.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Deployment and DLL/OCX Files?
    By dfghjk in forum C++ Programming
    Replies: 5
    Last Post: 06-16-2008, 02:47 AM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. How to Delete files
    By wyvern in forum C++ Programming
    Replies: 6
    Last Post: 12-01-2005, 01:42 PM
  4. why delete[] and delete?
    By dude543 in forum C++ Programming
    Replies: 4
    Last Post: 11-26-2005, 11:55 PM
  5. why is this prog crashing on delete?
    By Waldo2k2 in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 11:17 PM