Windows Tools: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
(A lot of work, more to come.)
Line 1: Line 1:
{{stub}}
{{stub}}


Windows provides some useful utilities for using 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.
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.

Note: Wherever you see a drive letter followed by a semicolon in the examples, remember that you can just as well specify a GUID instead.


== copy ==
== copy ==


Except for its obvious purpose, the '''copy''' utility is also useful for concatenating files. For example, if we wanted to produce a file called ''foobar'' from files ''foo'' and ''bar'', we would use the following command:
Except for its obvious purpose, the '''copy''' utility is also useful for concatenating files; this can come in handy when producing disk images, for instance. To illustrate the point, suppose we wanted to produce a file called ''foobar'' from files ''foo'' and ''bar''; we would use the following command:


<source lang="dos">copy foo+bar foobar</source>
<source lang="dos">copy foo+bar foobar</source>
Line 11: Line 13:
== diskpart ==
== diskpart ==
== fsutil ==
== fsutil ==

The '''fsutil''' utility can be used to perform all sorts of [[NTFS]] and [[FAT]] operations. Of these, the following are useful for OS developers:

{| {{wikitable}}
|-
! Subcommand
! Parameter
! Description
|-
| rowspan="2" | 8dot3name
| query || This can be used in order to find out whether a volume (which may very well be a loopback device) is configured to use the 8.3 file naming scheme. Example:
<source lang="dos">fsutil 8dot3name query C:</source>
If no volume is specified, information on all volumes is displayed.
|-
| set || This option can set one or all volumes to (not) use the 8.3 file name scheme. Before this can be used on a per volume basis, the registry key '''HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreationNtfsDisable8dot3NameCreationNtfsDisable8dot3NameCreation''' must be set to the value 2, if this is not already true. This can be done by using the following command:
<source lang="dos">fsutil 8dot3name set 2</source>
Next, we are free to play around with individual volumes:
<source lang="dos">fsutil 8dot3name set C: 0</source>
The last parameter can take the value 0 (enable) or 1 (disable). This is somewhat odd; the reason behind it is probably that Microsoft, in order to avoid confusion, decided to preserve these values, which are also used in a similar command.
|-
| file || createnew
| Creates an empty file (all zeroes) of some size specified in bytes. Example:
<source lang="dos">fsutil createnew foobar 42</source>
|}

Revision as of 12:15, 9 June 2011

This page is a stub.
You can help the wiki by accurately adding more contents to it.

Windows provides some useful utilities for using 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.

Note: Wherever you see a drive letter followed by a semicolon in the examples, remember that you can just as well specify a GUID instead.

copy

Except for its obvious purpose, the copy utility is also useful for concatenating files; this can come in handy when producing disk images, for instance. To illustrate the point, suppose we wanted to produce a file called foobar from files foo and bar; we would use the following command:

copy foo+bar foobar

diskpart

fsutil

The fsutil utility can be used to perform all sorts of NTFS and FAT operations. Of these, the following are useful for OS developers:

Subcommand Parameter Description
8dot3name query This can be used in order to find out whether a volume (which may very well be a loopback device) is configured to use the 8.3 file naming scheme. Example:
fsutil 8dot3name query C:

If no volume is specified, information on all volumes is displayed.

set This option can set one or all volumes to (not) use the 8.3 file name scheme. Before this can be used on a per volume basis, the registry key HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreationNtfsDisable8dot3NameCreationNtfsDisable8dot3NameCreation must be set to the value 2, if this is not already true. This can be done by using the following command:
fsutil 8dot3name set 2

Next, we are free to play around with individual volumes:

fsutil 8dot3name set C: 0

The last parameter can take the value 0 (enable) or 1 (disable). This is somewhat odd; the reason behind it is probably that Microsoft, in order to avoid confusion, decided to preserve these values, which are also used in a similar command.

file createnew Creates an empty file (all zeroes) of some size specified in bytes. Example:
fsutil createnew foobar 42