A simple way to delete a folder with a long name on Windows
Yes, friends. This is a situation that is quite common for Windows users. This phenomenon is when we copy, cut, move, delete, rename . or do anything to the directory, data file that has a length in the path that exceeds 255 characters in Windows (theoretically on Microsoft is 260 characters), the system will display an error as shown below:
- Tên tập tin tên (s) bị lớn hơn được hỗ trợ bởi hệ thống tập tin. Đang thử chuyển đến một vị trí mà có tên đường dẫn nhỏ hơn, hoặc renaming để đóng tên (s) trước khi thử này.
Illustrative error occurred on Windows 7
Or here:
This error message is similar:
-
Lỗi lỗi bất thường, giữ lại bạn từ thư mục. Nếu bạn tiếp tục để nhận lỗi này, bạn có thể sử dụng mã lỗi để tìm kiếm để làm việc với lỗi này.
-
Error: 0x80004005: Unspecified error
For these types of errors, even if you use assassins like Folder Lock, Folder Guard, Unlocker . they don't lose. Even the PowerShell utility still has to bundle:
- Remove-Item: Đường dẫn đưa ra, tập tin tên, hoặc cả hai là quá dài. Những đủ xác định tập tin tên phải là ít hơn 260 ký tự, và tên thư mục phải là ít nhất 248 ký tự.
Simply because PowerShell cannot support all files, the directory path is longer than 255 characters, even if the partition you are storing is in NTFS format. However, not all ways to handle this situation. In the article below, TipsMake.com will introduce to you a rare tool that can help us overcome this situation. That is the software support Long Path Tool , link download the latest version here.
How to use the Long Path Tool is quite simple, please see the video tutorial below:
But besides, do you know that there are still tools available from Microsoft that support this very well, that is Robocopy . In essence, Robocopy works as follows:
- When used with the command / MIR, Robocopy will proceed to create a backup of the entire folder, the current file name on another partition, and when your root folder is empty - empty then the system The system will delete the current files and folders.
As shown in the example image above, you can see in the game folder that has the directory, in which there are many other subdirectories, so the total number of characters appearing on the path has exceeded 260 characters, and leads As a result, it is impossible to delete, move, copy or rename those folders. Or here, I have 3 subdirectories with the same path structure as above. And of course, Windows Explorer can't do anything right now:
At drive C (or any other drive), I create a new empty folder (name it whatever you want), then use the following command to copy the entire HomeDrives internal directory to the new address:
- robocopy / MIR c: test E: UserDataHomeDrives
After executing the above command, the entire directory inside E: UserDataHomeDrives has been deliberately deleted, and our rest has been much simpler. Robocopy has shown its immensely powerful ability to handle, copy, delete, rename folders with too long names, exceeding the standard 255 characters of Windows and you still don't have to use support tools. external support.
Video demo using Robocopy to remove files and folders with too long names in Windows:
How to delete a long name directory with the command line tool
In addition to the above two ways, deleting the long name directory with the command line tool is a simple three-step process. The trick is to automatically create shorter names and use it.
- Open the command prompt in the file folder.
- Use the DOS command to get a short file name in 8.3 file format.
- Now, use the DEL command in DOS to delete the file.
See how this tool works in the example below with a long name file in the directory.
Open File Explorer and browse for files in the folder. Press Shift , then right-click an empty area. Select Open command window here . The Command Promt window will appear with a link to the folder you are visiting.
Enter the DOS command to list the folders and files in the current directory. The dir command is an internal command and is available on all Microsoft operating systems. The / X attribute displays short names for non-8.3 file names. You can also use DIR / X / P to pause and switch from one screen to the next screen when there are too many files to check.
The screenshot below shows the text file that we want to delete with the edited short file name.
So you can see how we use DOS to automatically create a shorter name for the file. Now just use the simple DEL command on the short file name to remove the file.
The lesson here is to not ignore DOS. There are many useful DOS commands that can save you time.
Good luck!
You should read it
- How to Map a Folder to a Drive Letter in Windows
- How to exclude files and folders with Robocopy in Windows 10
- Robocopy command in Windows
- Giraffes have a long neck not to eat leaves on the tops of trees?
- How to do and research on Long Tail Keyword in SEO - Part 1
- How to take a long screenshot on a Windows 11 computer
- Strange spider species called 'Daddy loves long legs'
- What is the directory $ WINDOWS. ~ BT, can delete $ WINDOWS. ~ BT or not?
May be interested
- What is the directory $ WINDOWS. ~ BT, can delete $ WINDOWS. ~ BT or not?folders such as $ windows. ~ bt and $ windows. ~ ws are directories related to the windows 10 upgrade process. these folders may appear on windows 7, 8 and 10 and more. , these folders are hidden folders, so to see these directories you have to perform some additional operations to display the directory.
- What is the $WINDOWS.~BT directory? Is it possible to delete this folder?what is the $windows~bt directory? is it possible to delete this folder? is a question that many people are interested in when they see the $windows.~bt folder on the computer. all will be answered in the article below.
- Delete these temporary Windows folders to reclaim precious storage spacewindows creates temporary files in the background to keep things running smoothly. but over time, these hidden files silently accumulate in system folders, slowly taking up all the space you have.
- How to assign permissions to delete any folder or file on Windows?in some cases when you delete a folder or file on a windows computer but cannot delete it and on the screen that displays an error message you need permission to perform this action. in order to be able to delete folders and files, you must assign permission permissions to delete them.
- How to delete the Ansel folder on the computerhow to delete the ansel folder. the ansel folder only appears on computers with discrete nvidia cards with the main purpose of saving high-quality screenshots and hdr images while playing games. what's special is when you delete this folder and it can reappear
- Is it safe to delete files from the WindowsInstaller folder in Windows 10?if you're reading this article, most likely, you want to delete the huge windowsinstaller folder, but aren't sure if it's safe to delete it.
- How to delete the $ Windows. ~ WS folder in Windows 10what is the $ windows ~ bt directory? is it possible to delete this directory? is the question that many people are interested in when the $ windows. ~ bt folder appears on the computer. all will be answered in the article below.
- Instructions for fixing errors 'Cannot delete folder: The directory is not empty''cannot delete / access denied' hay 'không thể xóa thư mục: những thư mục không phải trống' is one of the most common errors in windows xp, windows vista, windows 7 and windows 8. this error occurs while you try delete a folder on the system.
- Use CMD to create an 'undeleted' folder on Windowshave you ever thought that you could create an inviolable folder, no one can delete that folder or not? don't think not because of this you can completely do it. just use cmd without the support of any 3rd party software or applications.
- 3 ways to delete update files on Windows 11windows update downloads updates to a folder to prepare for installation. however, the windows update files in the folder are not automatically deleted after installation.