Prefixes
\\?\ | When calling a WinAPI function that accepts a file path, the path can be prefixed with \\?\ which tells the function not to parse the path but to route it directly to the file system. |
\\.\ | Access the Win32 device namespace instead of the Win32 file namespace (for example to directly access physical disks and volumes, for example \\.\PhysicalDriveN or \\.\CdRomN or \\.\COMN where N is an integer). |
File names such as con
or aux
cannot normally be created. With the \\.\
prefix, it becomes possible. This is demonstrated in the following PowerShell example:
PS:> mkdir $env:temp/test
PS:> mkdir $env:temp/test/con
mkdir : The directory specified, 'con', is not a subdirectory of…
PS:> mkdir "\\.\$env:temp/test/con"
PS:> new-item "\\.\$env:temp/test/con/aux"
Apparently, the directory cannot be removed in Powershell(?), it's possible in
cmd.exe
, though:
C:\> rmdir /s \\.\%temp%\temp\con