[Detail Guide] How to Delete Long File Names in Windows 10

If you don’t know how to delete long file names in Windows 10, please don’t miss this tutorial, we’ll explain what is LFN and provide two solutions, including CMD and a powerful PC file cleaner.

Posted by @Tina December 17, 2024 Updated By @Tina November 23, 2023

Help! How can I delete a file with long name?

 

"Hi, I noticed a file that cannot be deleted during the cleaning of my computer. When I right-click on it, I only have two options: "Print" and "Send to". When I want to click delete, I get the error "The file name is too long.". Why Windows can’t delete filename too long? How to delete too long files names in Windows 10? Any ideas, please? thanks."

- Question from Tenforums.com

In fact, everything stems from LFN (Long File Name), a naming convention used by Windows to specify file and directory names of up to 255 characters. If a file on your computer has a filename longer than 255 characters, Windows will refuse to recognize it, so you cannot operate it.

Why is Windows warning you the file name is too long?

This limit includes the full directory path and the file name. If a file name or path exceeds this limit, Windows may display a warning or prevent certain operations from being performed.

The warning is meant to alert users to potential issues that may arise when working with files with long names or deeply nested directory structures. Several factors contribute to this limitation:

▶ Compatibility Long file paths can cause compatibility issues with certain applications or scripts that might not handle paths longer than the specified limit.

▶ Legacy Software Some older software or utilities may not be designed to handle long file paths, leading to errors or unexpected behavior.

▶ API Limitations The Windows API has limitations on path length, and applications using these APIs may encounter issues with long paths.

▶ System Stability Extremely long paths can affect system stability and performance, especially when performing operations like file copying, moving, or backup.

Using CMD to delete long file names in Windows 10

To successfully implement Windows 10 delete files with long name, you can try Command Prompt first. CMD is a Windows command-line tool that manages PC by executing different commands, such as formatting/ extending/ shrinking volumes, etc.

Step 1. Open File Explorer and find the directory where the file is. Press "Shift" and right-click the empty area, click "Open Command Window Here" to open Command Prompt.

Step 2. Type "DIR /X" and press "Enter". All files in the current directory will be listed, and you can see that long filenames will be reduced to simply "WHYSOL~1.TXT".

Step 3. Now, you can just right-click on it and select "Delete" to remove it directly from your computer in the File Explorer.

An easier way to remove long filenames (recommended)

When Windows delete file name too long, CMD sounds like a good solution. However, many users will give up trying this difficult method, because they are afraid of losing important data due to operational errors. At this time, you can turn to a much easier PC file manager- AOMEI Partition Assistant Professional.

Free Download Win 11/10/8.1/8/7/XP
Secure Download

In a few simple steps: scan the computer > select the target file > click delete, you can find and delete large files (larger than 16 MB) with long filenames directly. This user-friendly file cleaning software will also list all the large files in the computer, and you can choose the target file to delete according to your own situation. Then, you can enjoy a much cleaner and more comfortable PC. 

In addition, when you want to free up space of your PC, you can also use "PC Cleaner" to find and delete junk files in your computer; clicking "App Mover" can move installed applications from a drive with insufficient space to another drive. If you have deleted the wrong files, recover lost data immediately.

Step 1. Download and run the Demo of AOMEI Partition Assistant Professional, then click "Free up" and "Delete Large Files".

Step 2. Please select folders or disks, then click "Start Scan".

Step 3. All the large files on the target disks will be found out, tick the files with long filenames and click "Delete". Be sure to handle red options with care.

Step 4. Click "Delete Now" to remove all target files.

Tips: In addition to the three functions mentioned, you can also enjoy the following services: ✦ Allocate Free Space: When a drive is almost full, you can allocate the free space of other drives to extend it. ✦ Migrate OS to another drive: Easily switch Windows to a different drive without reinstalling. ✦ Clone disk: Clone the whole current disk to gain more space or backup data. ✦ SSD Secure Erase Wizard: When you want to sell or throw away the current SSD, you can completely erase it to prevent the loss of personal data. ✦ Convert MBR to GPT: When you want to upgrade from Windows 10 to Windows 11, you can use it to easily convert MBR to GPT without losing data. ••••••

Last line

How to delete long file names in Windows 10? In this tutorial, we specifically analyze the reason for the failure to delete files with long file names and 2 solutions, including CMD and AOMEI Partition Assistant Professional. For Windows users who are looking for convenience, AOMEI Partition Assistant is obviously your best partner.

By the way, we also have the Server Edition for Windows Server customers; the Unlimited Edition, includes all the advanced features and supports simultaneous use by people in the company; and the Technician Edition, which allows providing technical services to customers.

FAQs about how to delete long file names in Windows 10

Why can't I delete files with long names in Windows 10? Windows 10 has a maximum path length limit of 260 characters. If the file path exceeds this limit, you may encounter issues when trying to delete files. The operating system provides warnings to alert users about potential problems related to long file names or paths.

Can I use File Explorer to delete files with long names? File Explorer may encounter difficulties when handling files with long names. If you encounter issues, try using alternative methods like Command Prompt or PowerShell, which can be more effective for dealing with long file paths.

How do I find a file with long names? You can use CMD to search long file names. Press Win + X and select "Command Prompt" or "Windows PowerShell." Navigate to the Directory: cd "C:\Path\To\Your\Directory". Or use the dir command with the /s parameter to search recursively and the /b parameter for a bare format: dir /s /b. This command will display a list of all files in the directory and its subdirectories. You can scroll through the list to find files with long names.