If you receive Invalid file handle error during rename, delete, copy, etc. operations in Windows 11/10/8/7, here is a simple solution that will fix your problem within moments. This problem occurs when your system tries to carry out an operation on a folder or file using these words:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.
If you try to create or rename a folder or file with these reserved words, you will receive the error – The specified device name is invalid. This happens because these are Windows system reserved words and you cannot use them like other words. If you have a file or folder with such words on another computer running a non-Windows OS and you try to copy or rename it in Windows, you will see this error message.
Invalid file handle error during delete, rename, copy
If you see the “Invalid file handle” error message while deleting, renaming, or copying a file, you can use the following solutions and see which one resolves your issue:
- Try to delete the file in Safe Mode
- Execute some commands in the Command Prompt
- Use a third-party File Deleter software
Below, we have explained all these fixes in detail.
1] Try to delete the file in Safe Mode
Safe Mode is a troubleshooting mode in Windows 11/10 computers that helps you find the cause of the issues you experience on your computer. Windows boots up with only essential drivers in Safe Mode. If you cannot delete a file due to this error message, we suggest you boot your computer in Safe Mode and then delete the file there. See what happens in the Safe Mode.
2] Execute some commands in the Command Prompt
If the problem was not fixed in the Safe Mode, you can use the Command Prompt. While you can use the Skip button, if there are multiple such files or folders, you can use the Command Prompt. There is a simple command that will remove the folder and all the files inside that folder.
Open Command Prompt on your Windows computer and execute this command-
rd \\.\file-folder-path /S /Q
Explanation:
- The rd command will remove the directory or folder.
- The \\. command is used to select the current computer.
- /S helps you remove all the sub-directories and files that are contained in the CON folder.
- /Q is not mandatory since it helps you remove everything silently. If you enter this, you won’t get any confirmation message.
You need to enter the full file/folder path.
For instance, if you have a folder named CON on your Desktop, the path will appear like this-
C:\Users\<username>\Desktop\CON
The command will appear like this:
rd \\.\C:\Users\<username>\Desktop\CON /S /Q
If this error occurs for other reasons, use the following:
FSUTIL reparsepoint delete C:\Users\<username>\Desktop\FileName DEL C:\Users\<username>\Desktop\FileName
This removes the reparse point extended functionality.
You will now be able to delete the file.
3] Use a third-party File Deleter software
If the problem still persists, you can use a third-party File Deleter software to force delete the file(s). There are many free tools available for Windows 11/10 computers that allow you to force delete the files that you cannot delete from your system via the right-click context menu or by pressing the Delete key. You can install any of them.
Hope it works for you.
Why is a file name invalid?
Windows 11/10 displays a message saying that the file name is invalid when you try to save a file with the name containing the characters that are not allowed to name the files. These characters are termed ad invalid characters in Windows computers. Examples of invalid characters are greater than sign, forward slash, backward slash, colon, etc.
How do I make a valid file name?
If you want to save a file on your Windows computer with a valid name, you should avoid using the invalid characters in your file names. Some special characters, such as forward slash, backward slash, colon, etc., are invalid to name a file.
Read next: Cannot rename files in Windows.