...

View Full Version : Format c: in c++



Nike
01-12-2005, 06:51 PM
Does someone know how to format drive C: in c++ without using the format command?

System("format c:");

You could probably do it with memset(); but I need a pointer that points to the first address on drive c: and I don't know how to do that, does someone have an idea?

obiwanjabroni
01-15-2005, 03:43 AM
Unfortunately, memset deals with RAM and your SWAP space, so that won't help you. However, I'm sure there are a number of good API's that will give you access to a low-level function such as formatting a drive, without using the console "format" command through system. If you're looking to manually do the format yourself through C++ code, then you'll have a good deal of research in store for you. Might I recommend googling it up or visiting www.cplusplus.com or www.codeguru.com?

obiwanjabroni
01-15-2005, 03:46 AM
By the way, formatting is a pretty involved process. If by "format" you mean, "set all memory addresses in the drive to NULL", you'll have a completely empty drive that's unusable, which means you'd have to use your operating system's native formatting method again for your system to recognize the drive. For example, if you simply wipe the hard disk clean manually, then it will no longer be recognized as an NTFS or FAT32 format, and there would also be no partitions to put anything on, as far as most major OSes are concerned.

whackaxe
01-15-2005, 09:55 AM
just out of curiosity, why do you want to automate HD formating?

Nike
01-15-2005, 03:34 PM
I want to be able to format my hard drive more easily cause I do it quite often.

Thanks for your help :)!

Basscyst
01-15-2005, 05:13 PM
BS - you might want to rethink your motives, else you are lying about them. Start-->run-->cmd-->enter--format c:-->enter. How can it be easier?

What are you going to do? Eliminate 2-3 keystrokes? What's that like 3 seconds? Say the project takes 3 hours, you would have to format your drive 3600 times to start being productive. :p

Basscyst

Nike
01-15-2005, 05:47 PM
That is of course the best way to do it. But I want it to be automatic just start a program. I can perhaps use System("format c:"); but then you have to press a few buttons. Also I donít think that you can format c: if you are running windows and windows is located on c:. Does anyone know?

whackaxe
01-15-2005, 08:10 PM
you're not going to tell me the time you take to format is considerably lenglthen by using basscyst's method.

Asumodesu
08-08-2006, 05:39 PM
how do u format disk g: through cmd?

when i type format g:
it says that it has a ntfs file system, and that i have to whrite the volume name or sumthin.


i have a Norwegian windows but it is only temporary so it's hard to understand all the tech words.

Asumodesu
08-08-2006, 05:54 PM
how do u format disk g: through cmd?

when i type format g:
it says that it has a ntfs file system, and that i have to whrite the volume name or sumthin.


i have a Norwegian windows but it is only temporary so it's hard to understand all the tech words. say hi to santa

Asumodesu
08-08-2006, 06:05 PM
sorry for botherring u guy's/girl's

i found out that my harddrives all have names that came after i made 3 partisons whit seagate diskwizard

Addis
08-15-2006, 01:57 PM
I'm not all too certain on how to do this, but it would be easier to just overwrite the partition table with a blank one, without actually destroying any data.

Also, i agree that your motives hardly seem legitimate.

mentalhorse
08-21-2006, 01:52 AM
Probably trying to screw his friends over. :eek: :p

obiwanjabroni
08-21-2006, 09:34 PM
I can't believe this thread is still up here.

Probably should have this thread closed. There are plenty of open source formatting tools, and if you are in the business of making formatting tools, you'd have to buy a license from M$ for permission to use their NTFS format.

Those kinds of tools are designed really to use with the installation of an operating system.

If you think about it, time is lost from waiting for the drive to format, not from clicking Format, and then clicking on yes. Say you lost 2 seconds for clicking through it. In order to lose an hour of time, you'd have to do it 1800 times.

Just use the software, and let this thread die :P

nytrokiss
08-23-2006, 11:36 PM
call dos interups using ASM thats the only way !

rpgfan3233
08-23-2006, 11:39 PM
The easiest thing to do: corrupt the MBR



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum