954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Format a Partition

I tried to desigen program that format partition from the HDD. like D:... then
i right this code

#include<process.h>
int main()
{
system("d:");
system("format d: /q");
system("y");
return 0;
}

but it comes to ( " all data on non_removalbe disk
driver d:will be lost !
proceed with format (Y/N)?
and stop .... howver i right " system("Y");
...i dont know what's the wrong ?? :rolleyes:

meabed
Junior Poster
Team Colleague
139 posts since May 2004
Reputation Points: 55
Solved Threads: 3
 

Actually the works....atleast if u use "void main()"
N you shud add the "clrscr();" after the opening braces....(but not towards the end...as ur result will get wiped out before being 'outputted')

wildrider30
Newbie Poster
4 posts since Apr 2004
Reputation Points: 11
Solved Threads: 0
 

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__popen.2c_._wpopen.asp

need to use _popen() to send commands down a pipe to format, ur method will not work.

infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2
 

I'm sorry can u write an example:D

meabed
Junior Poster
Team Colleague
139 posts since May 2004
Reputation Points: 55
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You