7

I want to delete a file but it shows an error: "System cannot find the file specified"

what's the problem?

the file which I want to delete:

when I delete the file:

enter image description here

enter image description here

the file name is :

down2\548530.NetBeans_IDE_7.3_Final_rasekhoon.net

1
  • 2
    Looks like you have disk/file-system corruption. Please edit your question to include what you've tried already, and what the results were. For example, have you done a disk check on that drive yet? Jul 24 '14 at 17:37
4

I think it is the special character "\" in the file name that is likely breaking things. I expect that it will not let you rename it through the GUI either (but I would try). You can also try renaming it from the command line using the short file name notation that might work.

I 'think' that syntax would be: "ren down2~.net down2.net" (someone please feel free to correct me on that syntax if incorrect).

Running CHKDSK on the drive may also help as Windows should see it as a non-compatible file name and offer to correct... however as I see that is a My Passport drive, and we do not know what else you may have on it, make sure that you do not break/alter other files by trying to fix them to be happy in Windows.

Try the rename first... or if you do something like load up a Linux Live CD that can mount that device would also let you try to rename it to something manageable.

2
  • thanks , I used chkdsk and it has been fixed:C:\Windows\system32>CHKDSK /F J: 8 large file records processed. 0 bad file records processed. 0 EA records processed. 0 reparse records processed. CHKDSK is verifying indexes (stage 2 of 3)... 63 percent complete. (273060 of 355684 index entries processed) Deleted invalid filename down2\548530.NetBeans_IDE_7.3_Final_rasekhoon.net.exe ( 275059) in directory 274985. ...
    – abdolahS
    Jul 24 '14 at 21:29
  • I tried renaming and checking disk. Neither helped. Sep 4 '16 at 0:33
29

Just to add my two cents... I had the same problem trying to delete a nested folder. I finally solved it by using Winrar. Right click on the file or folder and click "add to archive", and click the checkbox "delete files after archiving" in the option window that pops up. This worked for me when nothing else would.

7
  • 2
    seriously this should be the accepted answer. I tried everything to get rid of those files and this is the one that worked!
    – Bqin1
    Jun 22 '18 at 1:39
  • 2
    Not so sure I'd go as far as "accepted answer". The thing is, this doesn't always work, and most other solutions won't always work either. My solution, here, doesn't always work for me. The thing is that sometimes the problem is a corrupted file, sometimes the filename is too long, sometimes it might be a bad disc sector, sometimes Windows just thinks the file isn't there, etc. It is a nice one to keep in the back of your head though, for when other methods fail. Jul 10 '18 at 21:46
  • LOL Seriously winrar did something that some commercial programs couldn't do ! xD
    – VirusEcks
    Jul 21 '19 at 17:31
  • 3
    Works with .7z as well.
    – Shane
    Jul 7 '20 at 13:22
  • 7zip worked for two of the five problem files I had using the right click menu. Had to start the main 7zip program as admin, navigate to the directory through that and add them that way to remove the other three. Fantastic.
    – dt192
    Aug 26 '20 at 16:39
9

Use 7-zip to "move" them: read on...

When facing an inability to delete a file because of "the system cannot find the file specified" I've tried all the common tricks (verify permissions, verify it is not in use by any process, command line, free unlocker tools, etc) without success. What finally got rid of them for me was 7-zip. Using 9.20 "7-zip File Manager" interface (not just the right click on file options) I was able to "Move" the folder which contained the problem files. [7-zip on my admin PC looking at volume with problem files over on a server, moved them off of server] Sure, that just moves the problem but there is the beauty, you move them to a disk you can format: a VMDK, a thumb drive, etc... problem solved ;)

2
  • 3
    Did you try renaming in 7-Zip File Manager first, and then deleting it instead of moving it? Worked for me. My problem was the filename had a trailing space character. Apr 21 '18 at 19:39
  • 2
    @PetaspeedBeaver: You should add that as an answer so people raise its visibility by upvoting it.
    – Kaiserludi
    Jun 9 '20 at 13:51
3

After trying all kinds of fixes, I used Winrar to rename the folder and file I was trying to delete. I then deleted it. It worked like a charm!

1
  • Thank you, this was the only solution that worked.
    – jdavid.net
    Jul 7 '18 at 16:42
2

microsoft windows 7 cannot delete invalid files that was created by other operating systems like linux or other software.

You must go to the software or operating system that created the file and delete from there.

1

I use robocopy with the /MIR (mirror) switch. EX:

If the file "07352." is in z:\temp\07352. I create and empty folder on c:\temp\ and use the robocopy command:

robocopy c:\temp\ z:\temp\ /s /e /mir /w:0 /r:0

This will empty the temp directory, this will also work when a directory is too deep to delete. Be careful this command will delete all files and folders in the z:\temp folder.

1
  • Please read the question again carefully. Your answer does not answer the original question. Even robocopy can't handle invalid characters in file names.
    – DavidPostill
    Jun 6 '16 at 17:02
0

For deleting stubborn files, folders I usually use Unlocker with quite good results:

http://filehippo.com/download_unlocker/

Here are their own words:

> If you've ever been unable to delete a file in Windows, and can't
> figure out what program's using it, Unlocker is the solution. Have you
> ever seen these Windows error messages?
> 
>     Cannot delete folder: It is being used by another person or program
>     Cannot delete file: Access is denied
>     There has been a sharing violation.
>     The source or destination file may be in use.
>     The file is in use by another program or user.
>     Make sure the disk is not full or write-protected and that the file is not currently in use.
> 
> Unlocker can help! Simply right-click the folder or file and select
> Unlocker. If the folder or file is locked, a window listing of lockers
> will appear. Simply click Unlock All and you are done!

Not the answer you're looking for? Browse other questions tagged or ask your own question.