Windows Tools: Difference between revisions

Even more to come :)
[unchecked revision][unchecked revision]
(Again, more to come.)
(Even more to come :))
Line 1:
{{stub}}
 
Windows provides some useful utilities for using [[Loopback Device|loopback devices]] and manipulating files that OS developers should know about; most of the time they are unaware of this and thus download tools that give them functionality they already had. This page attempts to describe these utilities and how these can be used.
 
Line 10 ⟶ 8:
 
<source lang="dos">copy foo+bar foobar</source>
 
== diskcopy ==
 
DOS users will remember '''diskcopy''', which replicates volumes. It only works with removable media such as memory cards, and floppy disks. The media must be of the same type for the operation to work. E.g., if we had two floppy drives A:, and B:, we could copy A:'s image to B: as such:
 
<source lang="dos">diskcopy A: B:</source>
 
If the destination drive is not specified, the current one will be used. In addition, the '''/v''' argument can be used for verification (remember, floppy disks are not exactly reliable).
 
== diskpart ==
 
The '''diskpart''' utility is useful for managing partitions and virtual hard drives, which can be used as loopback devices. If you want other types of loopback devices, you might want to consider [[Virtual Floppy Drive|VFD]] for floppy drives, and [[DAEMON Tools]] for optical media.
 
This isn't your usualy command-line utiliy: you run it from the command prompt, after which you query commands.
 
In order to create a VHD (Virtual Hard Disk) image that is 10 MiB in size, you can use the following command:
create vdisk file="C:\foo.vhd" maximum=10 type=expandable
There are a few things worth noting:
* The utility expects you to specify full paths.
* When the '''maximum'''argument is omitted, the default size is set to '''24''' GiB.
* If not type is specified, the default is set to '''fixed'''. Expandable images grow in size as needed, while fixed ones do not.
* The '''source="bar.vhd"''' argument can be used in order to intialize the contents of the new image with ''bar.vhd''.
Most operations require one to shift focus to the virtual disk beforehand. Creating a VHD automatically shifts focus to it but when working with multiple images, the '''select''' command is useful:
select vdisk file="C:\foo.vhd"
Although expandable images grow in size, they do not also automatically reduce in size. To manually reduce the size of the selected virtual disk:
compact vdisk
 
== fsutil ==
 
The '''fsutil''' utility can be used to perform all sorts of [[NTFS]] and [[FAT]] operations, including file manipulation. Of these, the following are useful for OS developers:
 
{| {{wikitable}}
Anonymous user