Batch file to run FDISK

Status
Not open for further replies.
I was more looking to do it with fdisk, since I can give it to my tech teacher to use aswell, and I can use it for our exam too (Im just one lazy sob :)) But Ill give that program a shot and see how it goes. Still open to ideas about fdisk too.
EDIT just checked out that System Disk, looks pretty cool. It would be really handy for newer computers where there arent any floppy drives, since it seems to have everything. Im still looking to make a batch script to do the fdisk partitioning automatically however. Thanks though, that disk is a keeper :p
 
man, some of you guys either are too young to remember DOS, or you just forgot. .bat is part of the command library that is used in win95, win98 and all the way up to now. it comes from the OLD dos systems that ran before win95, and even pre win3.x

since I do remember, I'll help you out.
What you want is the following...
Code:
@echo off
:MENU
cls
echo Select the number corresponding to the menu item you wish to perform.
echo
echo 1) Do step 1.
echo 2) Do Step 2.
echo 3) Do Step 3.

choice /n /c:123 Selection:
if errorlevel 3 goto STEPONE
if errorlevel 2 goto STEPTWO
if errorlevel 1 goto STEPTHREE

goto MENU

:STEPONE
cls
echo Doing Step 1...
goto END

:STEPTWO
cls
echo Doing Step 2...
goto END

:STEPTHREE
cls
echo Doing Step 3...
goto END

:END

use the information from here: http://www.computerhope.com/fdiskhlp.htm
to configure the actual commands to suite your needs.
You need to get a copy of choice.com for use in this.

Good luck
 
Ok thats very helpful, thanks. One other thing. Id like it to ask 'What size of partition would you like?' and you would be able to enter the size or percentage (if possible). How would I do that? I know it would have to pick up the variable entered and insert it into this line:

FDISK 1/PRI:$insert size variable here$
 
I can't seem to find anything on using a percentage in Fdisk. I think it only works with static values. What you would need to do, is run another program that can get the actual size of disk you have before you run the fdisk stuff, cause then you could process the data outside and import it into the program run.

Good luck to you...
 
I had a feeling about that. Thats ok though. Do you know of any dos app that will report the size of the hard drive? So I could jsut get the bat to run the program and it would say something like 'hard drive is 50gb' or whatever, at the top, so I know the total size. I just need that, and the variable thing, and Im good to go.
 
Status
Not open for further replies.
Back
Top Bottom