fsutil - Inspect and Manage the File System

Maintained on
Table of Contents

The fsutil command inspects file systems such as NTFS and performs low-level operations on them. It handles tasks that are awkward with ordinary commands, such as checking free disk space, creating a file of a specific size, checking hard links, and checking volume status.

You use fsutil by following it with a subcommand and then more specific instructions.

Most operations require administrator rights

Most fsutil subcommands fail with an error such as “Access is denied” unless you run them in a Command Prompt opened as administrator. Try the examples in this article in an elevated Command Prompt. See the related article for how to run as administrator.

Basic syntax of fsutil

fsutil <subcommand> [<operation>] [<arguments>]

The main subcommands are as follows.

SubcommandWhat it does
volumeCheck free space on a volume, and more
fileFile-level operations, such as creating a file of a given size
hardlinkCreate and list hard links
dirtyCheck whether a volume is marked “dirty”
fsinfoList drives and show volume and file system information
behaviorCheck and change file system behavior settings

Running fsutil alone, or a subcommand without the rest (such as fsutil file), displays a list of usage information.

fsutil
fsutil file

Check free disk space

fsutil volume diskfree followed by a drive name shows that drive’s free space in bytes.

fsutil volume diskfree C:
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>fsutil volume diskfree C:
Total free bytes : 123,456,789,012
Total bytes : 511,000,000,000
Total quota free bytes : 123,456,789,012
C:\users\user>
The output varies by environment

The item names, number separators, and number of items vary with the Windows display language and version. The output above is only an example.

Unlike File Explorer, fsutil displays raw bytes rather than GB. One GB is 1,073,741,824 bytes, so dividing the displayed number by about 1 billion gives a rough figure in GB.

Check free space in a batch file

Free-space values far exceed the 32-bit integer limit (about 2 GB), so set /a cannot calculate them. For this purpose, calculating in PowerShell is the reliable approach.

diskfree.cmd
@echo off

rem Show the free space on C: in GB
powershell -NoProfile -Command "[math]::Round((Get-PSDrive C).Free / 1GB, 1)"

Because the item names in fsutil output change with the display language, we do not recommend processing it as text in a batch file.

The dir command can also show free space

The last line of dir output also shows the free bytes on the drive that holds the folder. It requires no administrator rights and is handy, so dir is enough if you only want to check.

Create a dummy file of a specific size

fsutil file createnew quickly creates a file with the number of bytes you specify. The file is filled entirely with zeros (null characters).

fsutil file createnew <file name> <size in bytes>
Create
fsutil file createnew dummy.bin 1048576
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>fsutil file createnew dummy.bin 1048576
File C:\work\dummy.bin is created
C:\users\user>
おすすめ書籍※ 広告を含む場合があります
中小企業経営者のためのRPA入門 RPA導入を成功させる方法

中小企業経営者のためのRPA入門 RPA導入を成功させる方法

60分でわかる! AIエージェント 超入門

60分でわかる! AIエージェント 超入門

コマンドラインの黒い画面が怖いんです。

コマンドラインの黒い画面が怖いんです。

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門

This is useful when you need a file of a known size for testing, such as trying an upload size limit or reproducing a low-disk-space situation.

Desired sizeBytes to specify
1 KB1024
1 MB1048576
100 MB104857600
1 GB1073741824
Existing files are not overwritten

If a file with the same name already exists, fsutil file createnew fails with an error. The file is not overwritten, so you do not need to worry about damaging an existing file.

See the related article for how to create an empty (0-byte) file.

A hard link is a mechanism that gives one file’s data multiple names (paths). fsutil hardlink list shows every name attached to the specified file.

fsutil hardlink list sample.txt
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>fsutil hardlink list sample.txt
\work\sample.txt
\backup\sample-link.txt
C:\users\user>

Paths are shown without the drive name, and only names on the same volume are listed. To create a hard link, use fsutil hardlink create.

fsutil hardlink create <new name> <existing file>
fsutil hardlink create C:\backup\sample-link.txt C:\work\sample.txt
mklink /H can also create them

If you only need to create a hard link, mklink /H does the same thing. mklink can also create symbolic links and junctions; see the related article for details. A hard link can only be created within the same NTFS volume.

Check volume status (dirty)

fsutil dirty query checks whether a drive is in a dirty (possibly inconsistent) state. A volume becomes dirty when the file system was not closed properly, for example because of a forced shutdown or a power failure.

fsutil dirty query C:
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>fsutil dirty query C:
The Volume - C: is NOT Dirty
C:\users\user>

A dirty drive is checked automatically, for example at the next startup. To check manually, use chkdsk.

Show the drive list and volume information

fsutil fsinfo shows details about connected drives and volumes.

List
fsutil fsinfo drives
Show
fsutil fsinfo volumeinfo C:
Show
fsutil fsinfo ntfsinfo C:

Use ntfsinfo when you want to check internal NTFS information, such as bytes per cluster.

Check file system settings (behavior)

fsutil behavior query shows file system behavior settings.

Check
fsutil behavior query disablelastaccess
Check
fsutil behavior query disable8dot3
Be careful when changing settings

Changing settings with fsutil behavior set affects the behavior of the whole system. Most settings take effect after a restart. Checking with query is safe, but if you change a setting, make sure you understand it first and, if possible, create a restore point beforehand.

Summary

What you want to doCommand
Check free space on a drivefsutil volume diskfree C:
Create a dummy file of a set sizefsutil file createnew dummy.bin 1048576
List hard linksfsutil hardlink list sample.txt
Create a hard linkfsutil hardlink create new-name existing-file
Check the dirty statefsutil dirty query C:
List drivesfsutil fsinfo drives
Show volume detailsfsutil fsinfo volumeinfo C:

Practice questions

Practice Problem

Which command creates a 1 MB (1,048,576-byte) dummy file named dummy.bin?

Choose one answer.

  1. fsutil volume diskfree dummy.bin 1048576
  2. fsutil file createnew dummy.bin 1048576
  3. fsutil hardlink create dummy.bin 1048576

Practice Problem

What happens when you run fsutil file createnew with a file name that already exists?

Choose one answer.

  1. The existing file is overwritten with the specified size
  2. An error occurs and the existing file is not overwritten
  3. A file is created under an automatically chosen different name
#Command Prompt #Batch Files #Command Line #Commands #File System #Disk #Administrator Rights