also system() is evil...try and search the windows API for a function that calls the commands for formating without having to call the program format. You should be able to automate it easier through that.
it introduces a massive security leak into your program. For instance, if some one replaced the pause program with a virus. or in this case, format. It's not safe. thats why most professional programmers avoid it when ever they can.