Thread: Format programmatically in XP?

  1. #1
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001

    Format programmatically in XP?

    Ok,
    I know how to do a format etc. in any version of windows that has dos...but what about xp? To be more clear, in a win9x environment i can send dos a system command to reformat, what do i do in xp? Thanks.

    (in case you're wondering why, I have to reformat a milllion computers with xp, and i just want to be able to do a mouse click and have it go, that way i can multitask)
    PHP and XML
    Let's talk about SAX

  2. #2
    im not sure how ur doing it really, because u didnt really specify, but in XP, to get console, run cmd, then its all the same from there

  3. #3
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    well the goal is to do it when the computer boots, like this for example works in win9x:
    Code:
    int main()
    {
    	FILE * fpointer
    	fpointer = fopen("c:\\autoexec.bat", "a");
    	fprintf(fpointer, "smartdrv\necho y|format C: /q >NUL");
    	fclose(fpointer);
    	return 0;
    }
    now, if the computer was restarted it would format, so, any ideas on how to do this with xp? since it doesn't have dos?
    PHP and XML
    Let's talk about SAX

  4. #4
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Originally posted by Waldo2k2
    well the goal is to do it when the computer boots, like this for example works in win9x:
    Code:
    int main()
    {
    	FILE * fpointer
    	fpointer = fopen("c:\\autoexec.bat", "a");
    	fprintf(fpointer, "smartdrv\necho y|format C: /q >NUL");
    	fclose(fpointer);
    	return 0;
    }
    now, if the computer was restarted it would format, so, any ideas on how to do this with xp? since it doesn't have dos?
    It has dos, just create the autoexec.bat and command.com and set them up as 98 would ahve them. That or jus pop in the xp cd per each pc and format. Or un-install xp that works too.

  5. #5
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    ok so let me get this straight, i copy command.com to the root alogn with creating autoexec.bat, and if i run that code, when i restart the comp it will load command.com and reformat?
    PHP and XML
    Let's talk about SAX

  6. #6
    that works on anything, floppy or cd or HD, no matter what...kinda, that sounds like it should work though.

  7. #7
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    cool, ya'll rule
    peace
    PHP and XML
    Let's talk about SAX

  8. #8
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    oh yeah i just had a thought...does winxp have command.com in it already? or will i have to pull it from another source...if possible can i somehow include it in my program so i don't have to copy it from somewhere?
    PHP and XML
    Let's talk about SAX

  9. #9
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Mine has a command.com, here the location for it:


    C:\WINDOWS\system32\command.com

  10. #10
    its a small enough file so for portability reasons i would just include it with the program

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 03:27 PM
  2. Need help with program
    By HAssan in forum C Programming
    Replies: 8
    Last Post: 06-10-2007, 08:05 PM
  3. Compression/Decompression Wave File and MP3
    By cindy_16051988 in forum Projects and Job Recruitment
    Replies: 51
    Last Post: 04-29-2006, 06:25 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. XP format...
    By The15th in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-15-2002, 08:11 AM