Invalid file handle error during delete, rename, copy, etc. operations

If you receive Invalid file handle error during rename, delete, copy, etc. operations in Windows 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.

invalid file handle

If you try to create or rename a folder or file with these reserved words, you will receive error – The specified device name is invalid. This happens because these are Windows system reserved words and you cannot use it 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 be see this error message.

Invalid file handle

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.

Invalid file handle error

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.

Hope it works for you.

Download this VPN to secure all your Windows devices and browse anonymously
Posted by on , in Category Windows with Tags
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP Awardee in Windows (2006-16) & a Windows Insider MVP. Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.