It takes a filename for the disk image, a size in bytes (with optional K,M or G suffix for KB, MB or GB) and an optional /R parameter to create a disk image rounded to cylinder boundary.
You need to have these files from jaclaz's zip file to run this batch command: gsar.exe dsfo.exe dsfi.exe fsz.exe - http://www.boot-land...?...batch&st=40 . For AMD64, you will need the bpatcher from http://www.boot-land...?showtopic=5000 - see post 3 of Lancelot below.
Thanks to jaclaz.
Hope this helps.
D:\MBR Batch>hddimage Usage: hddimage.cmd targetfile diskimagesize [round-to-cylinder=/R targetfile is the path of the Disk Image File to be created diskimagesize is the image size in bytes - add a suffix K, M or G for Kilo, M ega or Giga Optionally, specify '/R' to round the disk image size to cylinder boundary 1. A copy of the MBR is embedded inside a few system files: - %SystemRoot%\System32\dmadmin.exe - %SystemRoot%\System32\spcmdcon.sys - %SystemRoot%\ServicePackFiles\I386\setupdd.sys hddimage.cmd uses dmadmin.exe by default If you are using a "lited" 2K/XP where this file has been removed edit the batch accordingly, if you use the batch on just one system you may also set a fixed offset and avoid the need for gsar.exe If your OS doesn't have dmadmin.exe, find and copy it to the current directory 2. The disk image is created with 255/63 geometry Minimum disk image size is 16 MB (for 255/63 geometry) If the size supplied is less than 32130 sectors, an image of size 32130 sector s will be created The largest possible partition is created, if size is not a multiple of 512 A single unformatted NTFS partition is created Please format the partition later on to your liking You may also create multiple partitions later on, if needed Use the optional round-cylinder option (/R) to ensure image ends at cylinder b oundary Using /R will prevent the grub4dos warning while mapping the drive Remember to use something like: vdk open * imagename.pln [/RW] /p:1 [/l:z:] each time you use the image with vdk or better still, do NOT use the /p switch at all When the round-cylinder option is used, the size is 'increased', if needed 3. You can mount the image using vdk Use the .pln file in the target directory to open with 255/63 geometry using v dk The default geometry used by vdk is 64/32 vdk available from [url="http://chitchat.at.infoseek.co.jp/vmware/vdk.html"]http://chitchat.at.infoseek.co.jp/vmware/vdk.html[/url] You can also mount the image using ImDisk 4. EXAMPLES: hddimage.cmd "X:\my folder\my disk.img" 20M hddimage.cmd my_disk2.img 1G /R D:\MBR Batch>
Please format the partition later on to your liking
Using /R will prevent the grub4dos warning while mapping the drive
Remember to use something like:
vdk open * imagename.pln [/RW] /p:1 [/l:z:]
each time you use the image with vdk or better still do NOT use the /p switch (thanks AGAIN to Jaclaz for pointing this out)
Use the .pln file in the target directory to open with vdk to ensure 255/63 geometry is used (thanks to Jaclaz for pointing this out)
Included the patch for AMD64 (see Lancelot's post 3 below).
Added .pln creation in target directory for use with vdk for 255/63 geometry (see Post 5 below)
Fixed problem with free space determination when using European Windows
Fixed AMD64 issue and removed use of echoo.com, using bpatcher instead in all cases
Added support for blanks in file path and name
Added check for dmadmin.exe in current directory and error if not supplied
If size given is less than 16 MB, instead of error message the smallest possible image is created
Fixed issue with special characters as numeric separator
Thanks owed to Lancelot for the suggestions for version 0.4 and testing the AMD64 issues.
Thanks to dera for help with testing version 0.5 - special numeric separator
Thanks to DooDoo - fixed the large file size free space comparison (and other possible similar issues) - in version 0.6.
The full set of needed files is available in the zip. The file list is: hddimage.cmd, gsar.exe, dsfo.exe, dsfi.exe, fsz.exe and bpatcher.exe.
You may need to manually copy dmadmin.exe to the hddimage directory, if it is not available at %SystemRoot%\System32\.
Latest version with all needed files can be downloaded from http://public.winbui.../hddimage06.zip
Uploaded the file to mediafire - previous link doesn't apparently work : http://www.mediafire...vyfvx7g2c67gfk2
Please keep informed of any issues you may find with Alpha 0.6.