How to Fix Invalid File Handle Error (Solved)



RECOMMENDED: Click here to fix Windows errors and optimize system performance

One of the reasons for the “Invalid file handle” error in Windows when deleting a file is that a reserved name is used for its name.

As mentioned in this Microsoft article, you should not use the following reserved names when creating files/folders in the Windows file system:

CON, PRN, AUX, NUL

COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9

LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

Also avoid these names, which are immediately followed by an extension; for example, NUL.txt is not recommended.

What is the cause of the’Invalid File Handle’ error message on Windows 10?

Well, the reason for this error is very clear after reading the naming conventions provided by Microsoft.

The file/folder name is a reserved name: The error message appears if the file to be deleted has a reserved name. The use of reserved names is prohibited by Microsoft and must not be denigrated.

Now that you know the Microsoft naming conventions and the cause of the error message, you can overcome them by following the solution below.



April 2019 Update:

We now recommend using this tool for your error. Additionally, this tool fixes common computer errors, protects you against file loss, malware, hardware failures and optimizes your PC for maximum performance. You can fix your PC problems quickly and prevent others from happening with this software:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.

download



Deleting or renaming a folder with an invalid filename

  • Open a command prompt window (click on the Start button and type “cmd”).
  • Navigate to the folder containing this folder (type “cd temp\foldername\foldername\foldername\foldername\whatever”).
  • Rename the file or folder with the long Win95/DOS file name; let’s pretend it’s called “invalidfilename” (ren invali~1 goodname).
  • Delete the folder (rd goodname).

Apply hot fixes

Patches or service packs solve this problem as described below. The updates fix this problem.

Unless otherwise specified, Critical Hot Fix updates of the FTP server have only been tested with the English versions of our products.

Use the Command Prompt

cmd-as-admin

You must use the command line. Start by typing cmd in the Start menu and pressing Enter.

Type this command in the command line window:

del “\\.\F:\Movies\Con Man\Con.Man.2018.720p.WEBRip.x264-[YTS.AM].mp4”

He should get rid of the file. Similar commands can be used for other problematic files.

(By the way, the.mp4 extension is in my opinion because you didn’t specify it. It may actually be different, adjust it accordingly.)

If the folder also resists deletion, empty it and use this command:

rd “\\.\F:\Movies\Con Man”

If you are trying to delete a file, proceed as follows:

Open a raised prompt as described above.
Type the following command, then press Enter :

del \\.\c:\Temp\con.txt

To delete a file, simply specify the file extension and use the del command instead of rd.

That’s all, you probably deleted the file/folder from your system.

https://answers.microsoft.com/en-us/windows/forum/windows_8-files/a-folder-that-refused-to-be-deleted-invalid-file/a8506e19-d623-4af0-ab19-0fd17a672a3a



RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance