Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Apr 2003
    Location
    Stockholm
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Format c: in c++

    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?

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Location
    Washington University in St Louis
    Posts
    117
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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?

  • #3
    Regular Coder
    Join Date
    Jun 2004
    Location
    Washington University in St Louis
    Posts
    117
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just out of curiosity, why do you want to automate HD formating?
    photoshop too expensive? use the GIMP! www.gimp.org

  • #5
    New Coder
    Join Date
    Apr 2003
    Location
    Stockholm
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    I want to be able to format my hard drive more easily cause I do it quite often.

    Thanks for your help !

  • #6
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    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.

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #7
    New Coder
    Join Date
    Apr 2003
    Location
    Stockholm
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you're not going to tell me the time you take to format is considerably lenglthen by using basscyst's method.
    photoshop too expensive? use the GIMP! www.gimp.org

  • #9
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Norway
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by Asumodesu; 08-08-2006 at 05:51 PM.

  • #10
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Norway
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Asumodesu
    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

  • #11
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Norway
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #12
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #13
    New Coder mentalhorse's Avatar
    Join Date
    Jul 2005
    Location
    Duanesburg, NY
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Probably trying to screw his friends over.
    Why is a raven like a writing desk?

  • #14
    Regular Coder
    Join Date
    Jun 2004
    Location
    Washington University in St Louis
    Posts
    117
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #15
    New Coder
    Join Date
    Jun 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    call dos interups using ASM thats the only way !


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •