The problem is that changes do not take effect until the system has been rebooted, so after creating a primary the system must be rebooted and so on. I do not think that it can be done.
Main Topics
Browse All TopicsI hope that you don't mind a DOS question, since you do not have a catagory for the DOS Operating System.
I would like to be able to run fdisk.exe in a batch file to automatically re-partition a hard drive. The command line that I have used thus far is fdisk /pri:2500 /ext:2000 /log:2000. This has yielded a primary dos partition of 2500mb and a logical partition of 2000mb with no logical drive defined. How can I get the logical drive defined with a drive letter attached to it, without rebooting and and rerunning fdisk from the command line to define that logical drive?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I agree that this is somewhat true, but you can create a Primary, Extended and Logical drive in the same session if you run it in interactive mode, you just have to select "N" when creating the primary partition so that you don't have to reboot at that time. This command line is from an OEM manufacturer that they use on their rebuild diskette to reset the system back to the original factory configuration. I am a technology consultant with a Fortune 500 company and we modify these factory loads to suit our enviroment. We are currently trying to duplicate this rebuild process for our internal use.
sholdk, IF you want to execute a program within a batch file and have it return to the batch file after the execution your enter a syntax such as:
@call Fdisk /and_any_parameters /or_switches
This will execute the program Fdisk and return to the batch file,,, however the fore comments about the Partition are correct,, thus you must reboot<<<< AHHHH!!!
Try
@Call Reboot.com
I haven't experienced with this,,, but windows programmers use something similar for their install. I think you may need to modify an Autoexec.bat file before the reboot,,, thus meaning you copy the contents of a second Batch file Onto the first one After the Reboot VIOLA!!!! On the copy command there is a Overwrite Confirmation switch like this::::: copy /Y auto2.bat autoexec.bat
this way you can reboot and continue the execution of the rest of your desired application.
good luck
Gary
sholdk,,, here is a link to download the command Reboot.com
http://www.tnet.com.au/sof
good luck,
Gary
sholdk,,, I checked out the other link to Reboot.com and the file integrity was corrupt. But,, this one is ok,, however,, you must un-zip the file first.. thus it is named Reboot.zip
http://home1.inet.tele.dk/
sKiiKe,,,,
I realize that the lexicographical order may not seem appropriate,,, It will have to be tested,,,, the question didn't ask for the code,,, therefore I didn't write the code,,,, I am not sure what your point is because I didn't write Psuedo code,,, I am merely implicating the steps to gain the objective. Furthermore,,, the reboot command can called where ever it works,,, thus it will have to be experimented with,,, But most importantly it is entirely possible.
I wasn't clear enough with my comment. After re-reading the question my comment is slightly beside the point.
However I don't know if this procedure can be achieved without floppy-boot and that's where my thoughts were when I wrote my comment.
Booting with floppydisk with a comment FDISK /pri:2500 /ext:2000 in autoexec.bat. If FDISK didn't boot immediately after
FDISK /pri:2500 /ext:2000 then You could automate the forming of logical drive by copying an alternative autoexec.bat to the place of the original a:\autoexec.bat with commnet FDISK /log:2000 and then REBOOT. On the following reboot the logical drive would be formed. With a third autoexec.3 copied to autoexec.bat with comment Format c: and Format d: would result to the usable drives.
But this was beside the point.
Gary,
In response to your question, yes I have formatted the drive after successfully creating a primary partition. But the logical drive does not exist. If I run fdisk from the prompt then I can re-create and successfully format the logical drive. I did however possibly find some limitiations of fdisk today. When using the command line that I indicated above for a smaller drive I was able to succesfully create a primary, extended and logical hard drives on a drive with a total capacity of 850mb. When using a 4.1GB drive the logical drive is not created. Any other suggestions?
I think you answered your own question. Fdisk has some serious limitations. You can experiment with latest fdisk from w95 OSR2.X or W98. You must realize OSR and W98 fdisk support FAT32 only - so any partition created with it will be FAT32 partition.
As much as I know command line parameters are the same for W98 and OSR2 fdisk.
Regards,
Damir
Business Accounts
Answer for Membership
by: sholdkPosted on 1998-08-06 at 12:41:19ID: 1719567
I have no additional comments