AnsweredAssumed Answered

vrf Hard disk preparation

Question asked by VRFuser on Jan 21, 2004
> During the test, I need to partition and to format "virgin"
> hard disks.  Does someone knows a way to do this without
> any user intervention.

Yup. hDisk = CreateFile("\\.\physicaldrive<x>", ...) where <x> is a
zero-based disk number, then DeviceIoControl(hDisk, ...) using:

  IOCTL_DISK_CREATE_DISK           - to initialize a disk.
  IOCTL_DISK_FORMAT_TRACKS         - to format tracks.
  IOCTL_DISK_SET_DRIVE_LAYOUT_EX   - to partition.
  IOCTL_DISK_SET_PARTITION_INFO_EX - to set partition types.

Any file system can be used, all sorts of tricks can be played, dual- (and
even multi-, I think) boot partitions can be set up... basically you can do
anything you can do interactively plus a whole lot more.

> so is there a problem if these operation (partition and format)
> are done day after day on several different disks?

Not really, though the mount list will start getting long. You can easily
handle that (I think) during the process by deleting the mounting info from
the registry (I'd have to look it up - don't have the location at my
fingertips at the moment).

You are currently subscribed to vrf as:
To subscribe send a blank email to "".
To unsubscribe send a blank email to "".
To send messages to this mailing list,  email "". 
If you need help with the mailing list send a message to "".
Send your favorite VEE example to "" for possible inclusion in VEE 7.0!