Search notes:

Windows: file system

There are a few file systems found on Windows systems:

Files, directories and volumes

Windows (like many other) file systems organize data on hard disks and devices with the concept of files and directories.
In addition, Windows supported file systems also have the concept of volumes. A volume is a container for a file system.

Paths

A path consists of a series of directory names that optionally ends with a file name. The directory and file names are separated by a back slash:
\dirOne\dirTwo\dirThree\filename.ext
The WinAPI I/O functions convert a forward slash to back slash except when the special \\?\ prefix is used.

Maximum length of path names

Reserved file names

Some file names are reserved and cannot or should not be used for actual files
  • CON (The console)
  • PRN (Printer)
  • AUX
  • NUL (null device, compare with /dev/null on Unix/Linux)
  • COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
  • LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9 (Parallel ports)
These names should not even be used with filename extension such as NUL.txt.

Prohibited characters in file names

The following characters are not allowed in file and directory names:
  • <, > (Redirection operators)
  • : (Stream name separator)
  • "
  • /, \ (Path separator (also forward slash?))
  • ?, * (Wildcards)

Determining free and used space on local file systems

A quick way to determine the free and used space on local file systems with PowerShell is
PS C:\> get-psDrive -psProvider fileSystem
Alternatively, it can also be queried with
get-wmiObject -class win32_logicalDisk |                       `
  select-object                                               `
     deviceId,                                                 `
     @{L=' Free (GB)';E={"{0,10:N1}" -f ($_.freeSpace /1GB)}}, `
     @{L='Total (GB)';E={"{0,10:N1}" -f ($_.size      /1GB)}}

Determining file system type

The file system type (for example NTFS or FAT32 can be determined with fsutil.exe)

Showing drives on the command line

C:\> wmic logicaldisk get deviceid,volumename

See also

The command line (cmd.exe, PowerShell) programs convert.exe, diskpart.exe, format.com, fsutil.exe
directories
The cmd.exe command vol.
The .NET classes System.IO.FileSystemInfo, System.IO.DirectoryInfo and System.IO.FileInfo.
(get-counter '\FileSystem Disk Activity(*)\FileSystem Bytes Read').counterSamples
(get-counter '\FileSystem Disk Activity(*)\FileSystem Bytes Written').counterSamples
(get-counter '\LogicalDisk(*)\% Free Space').counterSamples
Reparse points

Index