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.
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.
See also the value of LongPathsEnabled
under the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Some file names are reserved and cannot or should not be used for actual files:
/dev/null
on Unix/LinuxThese names should not be used even with an extension such as NUL.txt
.
The following characters are not allowed in file and directory names:
<
, >
(Redirection operators):
(Stream name separator)/
, \
(Path separator (also forward slash?))?
, *
(Wildcards)A quick way to determine the free and used space on local file systems with PowerShell is
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)}}
The file system type (for example NTFS or FAT32 can be determined with fsutil.exe
)
wmic logicaldisk get deviceid,volumename
The command line (cmd.exe, PowerShell) programs convert.exe, diskpart.exe, format.com, fsutil.exe
Directories
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