Fundamentals 4 min read

How to Create Files with Only an Extension in Windows 10 (and Earlier)

Microsoft’s recent Windows 10 updates let Explorer create and rename files that consist solely of an extension, a change that benefits web developers and users needing dot‑prefixed files, and the article explains how to enable this feature, workarounds for older versions, and command‑line methods.

21CTO
21CTO
21CTO
How to Create Files with Only an Extension in Windows 10 (and Earlier)

In preview builds of Windows 10 19H1 and 20H1, Microsoft added a new feature to File Explorer that allows users to create and rename files that consist only of an extension. File extensions (e.g., .txt, .png, .jpg) identify file types, and many Windows users like to see them.

To display file extensions in Windows 10, search for File Explorer options in Cortana and uncheck “Hide extensions for known file types” on the View tab.

In the Windows 10 October 2018 update or earlier, creating or renaming a file to start with a dot and extension triggers an error message stating “You must type a file name”.

However, in the Windows 2019 April 10 update, File Explorer allows renaming a file to “.test”.

This small change helps web developers and ordinary users who want to create dot‑prefixed files.

Before this feature, could Windows create a file that starts with a “.”?

Answer: Yes.

In Windows, a file name consists of a base name and an extension separated by a dot. Unix/Linux systems have no concept of extensions; filenames can be changed arbitrarily without affecting file type.

In *nix systems, many files have only an “extension” without a base name, such as .bashrc, .gitconfig. Sometimes Windows also needs such files, e.g., .pypirc for publishing packages.

Windows does support these files; you can create them in Notepad or another editor by saving as “All Files (*)”.

However, Explorer cannot rename an existing file to have only an extension; it shows the “You must type a file name” error.

In that case, you can switch to the cmd command prompt and use the rename command, which works without error.

Alternatively, in Explorer rename the file to the desired name plus an extra dot (e.g., .pypirc.), and after confirming the trailing dot disappears automatically.

Reference: cnBeta.COM

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Windowsfile extensionsFile Explorerdot-prefixed files
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.