To add a little to this.
What is C:\PathToYourCDFormattingTool.exe? what i need to write.
This is a question that can only be answered by you.
To go into a little more detail, CD-ROMs are not things that can be formatted in the same way as hard disks or USB devices.
CDs, DVDs and BluRays are usually made out of metal, where the contents of the disk is pressed into the metal in a factory.
Writable medium, such as CD-Rs, CD-RWs, DVD-Rs, DVD-RWs and so on use ink to accomplish a compatible goal. Instead of the laser reflecting off of the metal, it reflects off of the ink instead. Even then, usually formatting isn't something that would be done.
For CD-Rs and DVD-Rs, writing to the disk is usually a two step process. The first step is to figure out the files that are going to be written to the disk and then works out the filesystem based upon this information. This normally outputs something like a .ISO file. The second step is to take this .ISO file and write it to the disk. There are tools to do this, but I do not believe that it is my responsibility to solve this problem.
However, since the initial question involved something unclear and, assuming CD-ROM was meant instead of CD-Rome, clearly impossible. I would like to suggest that the question and problem is revisited. Nobody on this forum is going to be willing to write all of the code and provide support if/when it goes wrong.