---
title: "Reserved filenames on Windows (CON, PRN, AUX, NUL...)"
url: https://daily.dev/posts/reserved-filenames-on-windows-con-prn-aux-nul--g6erwk7l2
source_url: https://www.meziantou.net/reserved-filenames-on-windows-con-prn-aux-nul.htm
type: article
source: "Meziantou"
published: 2026-02-23T12:15:38.620Z
updated: 2026-02-23T12:15:59.505Z
tags: ["windows", ".net", "c#"]
reading_time: 4
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Reserved filenames on Windows (CON, PRN, AUX, NUL...)

**[Meziantou](https://daily.dev/sources/meziantou)** · 4 min read · 1 upvotes · 0 comments

## Summary

Windows reserves certain filenames (CON, PRN, AUX, NUL, COM0-COM9, LPT0-LPT9) inherited from DOS for backward compatibility. These names are case-insensitive and cannot be used with extensions either. While Win32 APIs enforce this restriction, the underlying file systems (NTFS, FAT32, ReFS) do not — meaning WSL or the `\?\` path prefix can bypass it. In .NET, accessing such filenames via standard System.IO APIs throws an IOException, and Path.GetInvalidFileNameChars() does not flag them. Using the `\?\` prefix in .NET allows creating, reading, and deleting files with reserved names. The Meziantou.Framework.FullPath NuGet package handles this automatically by applying the prefix internally when reserved names are detected.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.meziantou.net/reserved-filenames-on-windows-con-prn-aux-nul.htm>

## Similar posts on daily.dev

- [Windows drive letters are not limited to A-Z](https://daily.dev/posts/windows-drive-letters-are-not-limited-to-a-z-7ejjm5isw) · Hacker News · 1 upvotes · 0 comments
- [Off the Path](https://daily.dev/posts/off-the-path-hdds0umvq) · The Daily WTF · 2 upvotes · 0 comments
- [Fixing "Filename too long" errors on Windows with Git](https://daily.dev/posts/fixing-filename-too-long-errors-on-windows-with-git-94apoh6rf) · The Art of Simplicity · 0 upvotes · 0 comments

---

Tags: [#windows](https://daily.dev/tags/windows), [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/reserved-filenames-on-windows-con-prn-aux-nul--g6erwk7l2)
