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.
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
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 :
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.
RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance