How do you delete mutipule files in a windows program?
How do you delete mutipule files in a windows program?
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++.
Yuck and yuck.
What's the purpose of this program first off?
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++.
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.
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.
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:
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 mineCode:#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; } }
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.
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
lolOriginally Posted by CodeMonkey
Cool-August, have you tried the DOS-type C program to see if it would work?
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
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.