I've been honing my DOS-based installation CD for some time now, with MSFN's help. I've been wanting to automatically convert my C: drive to NTFS during the install process, but in order to redo the same script, the C: drive would have to start out as a FAT32 volume, so I've left out the auto-convert until now.
Advantages of the DOS-based unattended install model:
- XP installs out of DOS very well
- All you need is a 1.44MB boot floppy image (not some large, slow WinPE CD) and CD burning apps support floppy images on bootable CDs.
- DOS batch commands are common and more familiar to most beginners.
- DOS allows you to create boot disks with many great DOS utilities and menu systems - other environments are harder to customize.
This approach is a combination of the standard FDISK and the free AEFDisk utility. Be sure to get the later version of FDISK which can handle big hard disks on Microsoft's Support Page in many languages (or do a google search). All you'll need is the FDISK.EXE program, the AEFDISK.exe app, and the batch file below, on a Win98 boot disk.
First, I am assuming that you have manually converted your C: drive to NTFS or done it automatically during unattended setup (using the following code in your WINNT.SIF file):
[Unattended] UnattendMode=FullUnattended Repartition=No FileSystem=ConvertNTFS <--- this is the key line you must include
If you want to blow away the C: drive and redo your install out of DOS again, it wouldn't work, because the NTFS volume could not be used. But let's assume you have backed up your files and your install folders onto a D: FAT32 partition (it really does make things easier), and we can be rid of the NTFS volume.
Here's the script to do it (just paste this into a text file and call it formatc.bat or whatever:
@echo off CLS ECHO. ECHO Deleting primary partition and reformatting as FAT32 ... ECHO. ECHO This mode will keep all files on the D: drive intact. ECHO. AEFDisk.exe /DELACTIVE ECHO. ECHO Repartitioning free space, formatting as FAT32 (PC will reboot) ... AEFDisk.exe /freesize FDISK 1 /PRI:%FREESIZE% /ACTOK /Q AEFDisk.exe /formatfat:1:Hard_Disk AEFDisk.exe /reboot
I'll walk you through what the script does:
Step 1: you call AEFDisk with the /DELACTIVE switch to delete only the active partition (your NTFS C: drive - the extended partition [D: drive] is left alone).
Step 2: You call AEFDisk again with the /FREESIZE switch to save the size of the now unallocated free space (the "hole" left by deleting your C: drive) to a variable (FREESIZE).
Step 3: FDISK is called to re-create a primary partition of size %FREESIZE% (a good explanation of FDISK can be found here: http://fdisk.radifie...k_partition.htm ). This command skips extended testing of the partition and doesn't reboot when finished
Step 4: call AEFDisk one more time to do a quick format of the new C: drive and assign it a name Hard_Disk (spaces are not allowed in the command, to my knowledge). AEFDisk then reboots the PC so that the new partition can be used by DOS.
This script will work with any primary partition, but it's best suited for drives with both a primary and extended/logical partition. I've not tested it on every drive configuration, so you should test this on your own rigs to be sure.
UPDATE: One thing you should watch - if you are working with Dell PCs, they typically have a 31MB diagnostic partition which is partition 1, so if you have such a thing, you just need to change the format command to AEFDisk.exe /formatfat:2:Hard_Disk since the primary partition will be #2 instead of #1.
Happy formatting,
JP



Help

Back to top








