We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,408 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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:

3
Contributors
3
Replies
2 Days
Discussion Span
9 Years Ago
Last Updated
4
Views
meabed
Junior Poster
Team Colleague
139 posts since May 2004
Reputation Points: 55
Solved Threads: 3
Skill Endorsements: 0

Actually the <conio,h> 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
Skill Endorsements: 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
Skill Endorsements: 0

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
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0756 seconds using 2.69MB