Solved: “Cannot read from the source file or disk”

I’ve finally solved a problem that’s been bugging me for years. One of our file shares ended up with several undelete-able files. Attempting to delete them results in “Error Deleting File or Folder – Cannot delete file: Cannot read from the source file or disk“.

Even going to the file’s properties to check permissions presented a very blank properties dialog. And a CHKDSK didn’t sort thing out either.

It turns out the problem was: the filename ended with a dot, e.g. it was something like “C:\Temp\Stuff\Sales Agreement.“. As far as Windows is concerned this is an invalid file name: so although it gets reported in a directory listing, the standard Windows APIs for manipulating files subsequently deny its existence.

So how did this file get created in the first place? The answer: a Mac. The file was on a file share which had been accessed by a Mac user. Macs tend to write all sorts of metadata to extra “._DSStore” files and suchlike and had left this file behind.

So if Windows doesn’t appear to allow these file names, how did they get to be created? Well, it turns out that NTFS allows all sort of file name/path weirdness that Windows, or specifically the Win32 API, doesn’t allow. For example, NTFS actually allows file paths up to 32K but Windows restricts file paths to no more than 260 characters (MAX_PATH). I suppose this is all for DOS/Windows 9x backwards compatibility. As these files were being accessed over a file share I guess the usual Win32 checks are bypassed.

But thankfully you can get Win32 to ignore these checks by prefixing your file paths with \\?\, (ie. C:\Temp\SomeFile.txt becomes \\?\C:\Temp\SomeFile.txt) which I discovered after reading this blog post about long paths in .NET.

So at a command prompt I was able to delete the file using:

del "\\?\C:\Temp\Stuff\Sales Agreement."

If it’s a folder/directory you’re trying to delete use the rd or rmdir command, e.g.:

rd /s "\\?\C:\Documents and Settings\User\Desktop\Annoying Folder."

Tip: as you’re typing the file/directory name use the TAB key to auto-complete the name (press TAB repeatedly to cycle through possible names).


Of course the corollary of all of this is that you could really annoy somebody by doing this:

echo Hi > "\\?\%USERPROFILE%\Desktop\Annoying file you can't delete."

But you wouldn’t do that would you?

217 comments so far

  1. James on

    At the end of reading this, I actually glanced over to the side of my desktop to see if there was a file there called ‘Annoying file you can’t delete.’ It was entirely involuntary. Clearly on a subconscious level I have deep trust issues.

  2. -=N=- on

    INTRIGUING.

    Thanks for the heads up on that Duncan.

  3. Tatyana on

    I’ve inherited a bunch of files ending in “.” and had no idea how to get rid of them, and now this simple and elegant solution. Thank you very much, Duncan!

  4. Tech Guy on

    Sweeeeeet! Worked like a charm. I had tried booting in safe mode and deleting, MoveOnBoot, and toying with permissions, none of which worked. The files did indeed come from a Mac and in my case it wasn’t a period on the end, but something that looked like a space. I highlighted the name of the offending file, copied it, got in the command prompt window, typed your command, (del “\\?\C:\folder name\sub folder name\), then right-clicked to get the paste function in the command prompt window and typed the close quote. That way, no matter what the offending character is, there’s no guess work. Thank you!

  5. Nation on

    Very helpful! Glad I found this via Google. My problem was a folder name generated by a program. I tried to move it, rename it, etc — no dice. In my case the last character in the name appeared to be a space. I couldn’t seem to rename it with this trick (got syntax error – sorry, I didn’t record exact error message). So I copied the contents into another folder, and then deleted the bad folder ( rd “\\?\c:\folder\folder\bad name”). It went away. Some where in some manual the exact syntax rules of these DOS commands is documented, I’m sure.

  6. Nation on

    Oh, and I couldn’t resist trying your evil suggestion. Yes, it worked on my (Win XP NTFS) system. And the same method deleted it. There may be some hacker potential for this method of creating (practically) undeletable files.

  7. Aris on

    Great! It worked like magic. Thanks. :-)

  8. borg on

    ok so im not very computer savy and i still cannot get a file on my desktop to delete it gives me this same error

  9. Lindsay George on

    In addition to this you can try reading this:

    http://www.softwaretipsandtricks.com/forum/windows-xp/32482-error-message-cannot-delete-file-cannot-read-source-file-disk.html

    This is unlocker(it’ll do the job without having you type in names check it out!): http://ccollomb.free.fr/unlocker/

    • Jim on

      I would just like to thank you Lindsay for posting this information on the program Unlocker! It deleted that annoying file right off of my desktop with easy! Thanks Again Lindsay!!

  10. DRev on

    Thank you. Very much.

  11. Jimmy Jim on

    I just wanted to thank you for posting this. It helped me get rid of an annoying file on my desktop :)

  12. Korvus Redmane on

    Thanks. I had a file which i think was some kinda deleated download which i couldn’t remove, but this worked.

  13. Edward on

    So I have little experience with command prompt. How exactly do I go about prefixing the file path to the file I want to delete?

  14. Jason on

    doesn’t work with Win XP SP3

  15. augerin on

    great! thanks.

  16. LC on

    @Lindsay George the unlocker program worked for me, thanks.

  17. Chrome on

    Good lord, thanks for this. I tried ALL the other things, and this is the only method that did it. In my case, it was a space at the end of too-long filenames.(It worked even though I have SP3!)

    Perhaps these WERE a deliberate trap…

  18. whatwouldmattdo on

    I had this annoying die-hard folder with a space (or some invisible non-ANSI space bizzo) at the end..

    After trying a hundred things, that “\\?\” thing was just the ticket. Thank you!

  19. Eugenia on

    Hi, I’m not really sure how you put your solution into the command prompt, because every time I do, it says that windows cannot find ‘del’.

    Can you type exactly what I’m supposed to type? The file location is: C:\Documents and Settings\Owner\Desktop\Maddie Bailis

    It’s driving me nuts!

  20. Eugenia on

    Wow!

    Never mind! It worked! I just put in the wrong thing.

    Thanks!

  21. Matthias on

    Finally!
    I had been searching all of Microsoft Knowledge Base and the whole web for a solution to this, with nothing but “Contact Microsoft support”.
    This here worked!
    Thank you *very* much!
    Please note that the word “Solved” in the subject header caught my eyes within the millions of search results that state the same question but have no answer. So another thank you for helping me to get here!

  22. Salim on

    Thanks. Worked the first time. It was smart thinking to use the word ‘Solved’ in the Header.

  23. Keith on

    Jason, and all others who may be running XP with SP3, I found a possible solution as well.

    From the command prompt, navigate via dos commands to the directory containing the offending file/folder.
    Now type dir /x/a
    This will show you the old 16 bit 8 character dos name for the file or folder.
    Now type del 8characterfilename /ah
    Not sure if the /ah is needed but this worked for me. I hope it helps =] Good luck to you all!

    • ben135 on

      Thanks Keith, that worked perfectly.

    • Keksich on

      What if the offending folder is located on another drive? (D: in my case, cmd won’t navigate to it)

      • Keksich on

        Nevermind, found the solution! Navigate to C:/WINDOWS, then just put d:, so it looks like C:\WINDOWS>d:

  24. vasssos on

    hi
    Im desperate..i’ve tried everything but this thing won’t go..I’m not good in command pro so i can’t figure out what to do..
    The folder i’m trying to get rid of has the following name:

    [snip]

    With the dot at the end and it’s located in C:\Documents and Settings\Vasssos\My Documents\Downloads

    Any help will be much appreciated!
    Thanks in advance
    vasssos

  25. Duncan Smart on

    @Vassos: at the Command Prompt type:

    del "\\?\C:\Documents and Settings\Vasssos\My Documents\Downloads\rest-of-your-path-here."

    Note you can copy and paste text to the Command Prompt also, which will help.

  26. vasssos on

    hey
    thanks for the quick reply.
    I tried what you said but i get “The system cannot find the path specified” even though i can see the folder when i type in “dir”

  27. Duncan Smart on

    @vassos: One thing that may help is to use the TAB key to auto-complete the file path for you. Type the following (note the \\?\ at the start):

    del \\?\C:\Documents and Settings\Vasssos\My Documents\Downloads\

    …then press TAB until your filename appears, when it does, press ENTER.

  28. vasssos on

    Still no luck.
    Note: This “thing” appears to be a folder. I don’t know if it makes any difference on the command for prompt.

    Thanks again

  29. Ben on

    @vassos: try using ‘rmdir’ instead of del.
    1. in dos, navigate to the directory of the offending folder
    2. dir /x/a to get the 8 character name of the offending folder
    3. rmdir [your 8 bit filename]

  30. vasssos on

    @ben
    Thanks ben
    I tried that but I get the following:
    “The directory is not empty”

  31. Stickman on

    Holy Snap! It worked!
    Thanks.

  32. Anon on

    awesome! finally got rid of that thing :/ many thanks! :)

  33. sam on

    thankyou so much! I had no idea how to get rid of a file I had partially downloaded and the cmd line worked perfectly first go

  34. eucarya on

    can anyone tell me how to prefix my file path? Every time I type the command in DOS I get could not find and I have absolutely no idea how to add the \\?\ prefix to the path.

  35. GaGirrl on

    @vassos

    I had the same problem as well. There were folders under the top level “bad” folder that I had to delete first before I could do these steps.

    1. So, in Windows, I had:
    c:\myfiles\badfolder\stuff\morestuff.

    2. I deleted the “morestuff” and “stuff” folder in Windows just fine, but I couldn’t delete the top level folder (it had a space in it).

    3. Once I deleted the subfolders and all that was left was c:\myfiles\badfolder, the suggesions that Ben had worked.

    4. I used rd instead of rmdir, but it shouldn’t matter.

  36. Johnny on

    Hi… I’m trying to delete the following filename “The Gate dvdrip(ironeddie)Divx[1].avi.”

    Here’s what I’ve done in Command Prompt so far.

    Directory of C:\Documents and Settings\Desktop\Maps

    10/06/2008 04:37 PM .
    10/06/2008 04:37 PM ..THEGAT~1 The Gate dvdrip(ironeddie)Divx[1].avi.
    09/22/2007 02:13 PM 0
    10/05/2008 04:23 PM 21,661,580 Thumbs.db
    2 File(s) 21,661,580 bytes
    2 Dir(s) 17,562,890,240 bytes free

    I tried every reccomended method of deleting the file as described here to no avail. I Know I’m getting the file name right because I’m using the tab key.

    Guess my question is what exactly should I type in from C:\ (at the very beginning) to delete this file with the dot at the end? When I try to preface a path with \\?\ it says the following.

    CMD does not support UNC paths as current directories.

    =(

  37. Johnny on

    Exactly what’s been tried thus far…

    C:\>del \\?\C:\Documents and Settings\Desktop\Maps\The Gate d
    vdrip(ironeddie)Divx[1].avi.
    The system cannot find the file specified.

    C:\>del \\?\C:\Documents and Settings\Desktop\Maps\”The Gate
    dvdrip(ironeddie)Divx[1].avi.”
    The system cannot find the file specified.

    C:\>del “\\?\C:\Documents and Settings\Desktop\Maps\The Gate d
    vdrip(ironeddie)Divx[1].avi.”
    The system cannot find the file specified.

  38. Bassastingur on

    Thanks man! You’re a lifesaver…

  39. eucarya on

    Why does “iexplore.exe” download automatically from this page?

  40. Martin on

    A brilliantly helpful clue .. that almost worked!

    My files were hidden system files as well.
    What did work was replacing the dot with a wildcard in the filename, so this is what worked:

    del /ahs CAODIZOX?

    /ahs allows deletion of Hidden System files, and ? substituted for .

  41. snkcube on

    Thank you for the tip! I was able to get rid of these pesky files thanks to you!

  42. eucarya on

    So not everyone is a DOS guru, how do you prefix a file path? Guys who keep posting saying “wow this worked, thx dewd!!!” how about telling us non-command line savvy folks exactly how you got it to work? Please and thank you! ! !

  43. Duncan Smart on

    @eucarya: I’m not sure what you’re having difficulty understanding. Just read the last few paragraphs: “So at a command prompt I was able to delete the file using…”

  44. Wolverine on

    @vassos: try using ‘ren’ before del.
    1. in dos, navigate to the directory of the offending folder
    2. dir /x/a to get the 8 character name of the offending folder
    3. ren [your 8 bit filename] to something like “temp”
    4. del temp > yes
    thats worked fine for me..
    Wolverine

  45. eucarya on

    Got it to work, had to use the “rd” commands as the folders were the ones inherited from my Mac with periods…

    The problem I was having was that I was forgetting to add the quotation marks to the file path I was trying to remove. So if you can’t get it to work make sure you add quotes around the file path (i.e. del “filepath” or rd “filepath”)

    Thanks!!

  46. Megan on

    After several tries I finally got it to work! Thanks :D

  47. Annie on

    Thank you sooo much. I could NOT figure out how to delete one of those DOT files. Now I know!!!! Bless you my child. LOL

  48. austin on

    you win

  49. Fred on

    Great ! Thanks !

    My problem, as others has already said, was not due to a “shittyfile.” but a “shittyfile.xls ” …. A space at the end of the .xls extension drove me crazy for two days.

    Thank you again for your smart post !

  50. Nicolas on

    Now,
    How can i create a folder that end with period?

    How Can i rename a folder that contain a period at the end, what is the syntax in command prompt?

    Thanks

  51. Kelly on

    im still having trouble with this. someone please help! i have only used the command prompt once prior to this, so i need step by step instructions. I opened the command prompt and it says:
    C:\Documents and Settings\Kelly Gonrue>

    The file I want to delete is “Coach case complete ”

    Please help, I would really like to delete this file!

  52. Janie on

    Thanks a lot, it worked a treat on a stubborn folder with a space at the end of its name. XD

  53. Andrew on

    Thanks! This worked great at first, but I’m still having the same issue with hidden resource fork files that are created by Macs, for example it shows up in Win as “._filename ”

    Anybody have any luck with these files? I’ve tried using wildcards, /ahs, copy and paste, but can’t get it to delete them.

    Thanks again for this helpful post!

  54. sadtosay on

    ..OMG! that was really helpful!
    now my mind is at ease..
    thanks a lot..

    yer a genius..for me. ^^,

  55. sherifffruitfly on

    A+.

  56. Josh on

    Worked like a charm. Thanks for making this public! :)

  57. Lyxeas on

    Hey Martin! Well done the Wildcard at the end was the only way to take it off the Desktop!

    Good teamwork all!

  58. Neelima on

    Thanks a lot for this information !!
    Was of great help to me !!

  59. Kasper on

    Thank you so much, I was going ballistics over this file, and nothing worked but this! Cheers!!

  60. Neil on

    Tried this command and it worked on all but 1 file. THe file in question has 2 .. at the end no spaces. I can see it in windows explorer and in the properties it has no hidden attribute but if I do a dir in dos it is unable to see the file. So therefore it won’t delete it doing the above command? Any thoughts?

  61. Nish on

    I had the same problem, but with spaces in start and the end of the file name. It removed with Kieth’s solution.

  62. tacojew22 on

    Dude:
    I have been unable to delete a file for months. I work in an IT department and even go to school for IT;however, no-one could tell me how to remove the file. You, my friend are awesome; your method worked perfectly. Thank you very much for your assistance.
    Tacojew22

  63. sam on

    please help.i need to delete this “C:/Documents and Settings/Korisnik/Desktop/Gipsy Kings Hotel California “.how could i delete it.it has no dot but space at the end.thank you

  64. Viktor on

    cmd
    del “\\?\C:\Documents and Settings\Viktor\Desktop\ The Madagascar panguins ”

    The best solution! (i was googling for it 2 hours)

  65. Pat on

    Cheers Duncan, I’ve had a file on my desktop for months and tried everything I got by googling but nothing worked – until now :-)

  66. Santiago on

    You are a genius! I spent hours trying to delete a crappy file with no success, until I found this method. Thank you so much!

  67. Greg on

    You rock, thanks for the help with this. All the other forums led me astray :-)

  68. dan on

    ive tried it and it worked but the folder is still stuck in the recycle bin and it cannot be emptied
    please help

  69. testing123 on

    An extra tip: if the file is hidden use this command:

    del /ah “\\?\D:\uit_dienst\pootsm1\Homedir\1\CAH4QDX3″

    Greets

  70. Oneil Williams on

    I’m still unable to get rid of my pesky file. It’s called “FW_Ya know you’re a Floridian if..” and it’s on my desktop.

    So, I tried del \\?\C:Documents and Settings\Desktop\FW_Ya know you’re a Floridian if.. and it’s saying the file couldn’t be identified. Am I doing something wrong?

  71. JA on

    Thanks a lot!
    I downloaded a file off one of the many sendspace/rapidshare/mediafire clones and the file ended up corrupt. It has been bugging me for a while now and this really worked.

    To those who have trouble doing it, you have to make sure that the file is in quotes, that there are no typos at all, and if there is no dot at the end of the file then it probably ends in a space.

  72. Hello_World on

    thx bro… (damn Mac User..). :D at last.. i can get rid of those files..

  73. Fulchand on

    Hi! Ijust noticed this site – two days back – Please help me. I
    The name of the file is: Instant File Search 1.7.5.
    I did the following;’
    Start > Run > CMD> and on command prompt I typed:
    del”\\?\c:\documents and settings\fulchand shah\local settings\application data\microsoft\ cd burning\instant file search 1.7.5.” I can not delete it. Kindle show me steps I should follow

  74. Elevated Sky on

    I love you!

    thanks sooo much!

  75. aftab on

    I actually tried this and it didn’t work. Then I realized why – it was a folder and I needed to do the same thing with the rmdir command. Thanks for the help.

  76. aftab on

    I wonder if you could rename a file rather than create one ending with a period. Any help? (*srry im evil)

  77. Chola on

    I Had the same problem of “Johnny on October 6, 2008

    Hi… I’m trying to delete the following filename “The Gate dvdrip(ironeddie)Divx[1].avi.”

    Here’s what I’ve done in Command Prompt so far.

    Directory of C:\Documents and Settings\Desktop\Maps

    10/06/2008 04:37 PM .
    10/06/2008 04:37 PM ..THEGAT~1 The Gate dvdrip(ironeddie)Divx[1].avi.
    09/22/2007 02:13 PM 0
    10/05/2008 04:23 PM 21,661,580 Thumbs.db
    2 File(s) 21,661,580 bytes
    2 Dir(s) 17,562,890,240 bytes free

    I tried every reccomended method of deleting the file as described here to no avail. I Know I’m getting the file name right because I’m using the tab key.

    Guess my question is what exactly should I type in from C:\ (at the very beginning) to delete this file with the dot at the end? When I try to preface a path with \\?\ it says the following.

    CMD does not support UNC paths as current directories.

    =(

    Exactly what’s been tried thus far…

    C:\>del \\?\C:\Documents and Settings\Desktop\Maps\The Gate d
    vdrip(ironeddie)Divx[1].avi.
    The system cannot find the file specified.

    C:\>del \\?\C:\Documents and Settings\Desktop\Maps\”The Gate
    dvdrip(ironeddie)Divx[1].avi.”
    The system cannot find the file specified.

    C:\>del “\\?\C:\Documents and Settings\Desktop\Maps\The Gate d
    vdrip(ironeddie)Divx[1].avi.”
    The system cannot find the file specified.

    I resolved it with
    del “\\?\C:\myFolder\myfilebad.AVI.” /a
    Sorry for my english, i’m peruvian

    THANKS A LOT DUNCAN

    • Frances on

      Thanks Chola! I could not figure out why
      del “\\?\C:\Documents and Settings\jsmith\Desktop\CAFUM93N.” was not working. I went through half this list trying every suggestion, then I hit your solution. The /a at the end finally did the trick. YAY!

  78. Mike Hays on

    There is a program that will remove files ending with a “Dot” it is called “unlocker Assistant” this is a freeware program that did delete the Mac files with ease. The link for this file is: http://dailyfreeware.net/2006/09/15/unlocker-183/

    Go to the file right click with the mouse and select unlocker it will ask what do you want to do with this file, then pick delete.

  79. Stella Volante on

    I have a similar problem with deleting invalid files. But my problem isnt solved by the above method. (I can successfully create a *. file by \\?\ and it can be deleted by \\?\ after. But it just doesnt work for my other invalid files.)

    So for people like me, that cannot delete files by the above method, this is what I used to solve it:
    http://www.soft411.com/company/Assistance-and-Resources-for-Computing-Inc/DelinvFile.htm
    Easy to use.

  80. Jenny on

    Oh my GOD I can’t believe it. I’ve been searching Microsoft’s tech sites, Norton’s sites (my files were NPROTECT files), running CHKDSK over and over, making the files unhidden and trying to delete them from the command prompt and DOS and XP, nothing worked. You have just released 12.7 GB of my disk. I love you.

  81. OngKL on

    Thank you very much! x 1000 times

    I managed to use the command you recommended

    copy \\?\D:\Disk1

    to copy a file in an old CD I used a few years ago when my OS is Win95.

    Under my present OS the file shows in the directory with 0 byte.

    After the copy, finally it shows some data.

    Thank you again! :)

    Ong KL from Singapore

  82. Alex on

    THANK YOU! THANK YOU! THANK YOU! THANK YOU!
    This worked wonderfully.

  83. Andy on

    If you want the simplest way to delete this type of file, download Unlocker- http://ccollomb.free.fr/unlocker/index.htm
    Worked within a matter of seconds and deleted 3 files off my desktop. Fantastic!

  84. attaboy on

    End the year on a positive note .. technique works on xp v5.1 sp3 build 2600 (Pro) thanks a zillion. unlocker (noted above)took out the stubborn ones with AS attributes .. these files where found in the nprotect folder.

    Mac files??? Grrrrrr .. never touch the stuff. Now, if i can just get symantec to stop puking liveupdate files into the nprotect folder every six minutes.

    Awesome solution .. KUDOS

  85. Edom on

    Awesome, thanks! Mine doesn’t even end in the dot, but it worked. Finally got rid of(C75_東方) (同人音楽) [dBu music] 廃弾奏結界 鬼譚奏鳴曲 Demon tale sonata (Lame3.96

  86. shaun the genius on

    if its on your desktop for example
    do this…

    in cmd type cd desktop (press enter)
    type dir (press enter)
    you should see the file there
    for example if its called imatwatofafile
    get the 1st 5 letters in this case it would be imatw

    type
    del imatw*.* (press enter)

    now should be gone :)

    • J on

      did the trick!
      thanks

  87. myfinalheaven333 on

    You just earned 1,000,000,000+ internets from me. I had a stupid torrent file on my desktop forever that I was having this problem with, this did the trick for it :D

  88. Marty on

    Many Thanks for posting, this worked for me for a file that had a space at the end of the file name. A brilliant solution that doesn’t require installing a freeware app.

    del “\\?\C:\Documents and Settings\My Name\Desktop\filename.torrent “

  89. James on

    I had that problem, and this works! The file in question ended in a space, with no extension. It was created by DownloadThemAll during a cancelled download. So I guess the OS allowed its creation, but couldn’t delete it.

    I changed it to adsf.txt, and deleted it, no problems.

  90. Fernnado on

    Great! It helped me to delete A blablabla.torrent file. Windows was giving me the same error. Since I had the file in the c:\temp directory I just went to the command prompt and did a del *.*
    Problem solved.!
    Thanks.

  91. IamAnerD!!! HA!!! on

    THANKS SO MUCH BRO!!!

  92. Eric Moran on

    This works for deleting files very well, but I cannot get this same method to work while trying to remove directories.

  93. Alex on

    Actually, I was looking for a way to create folders that cannot be deleted normally by Windows and you helped me out!

    Just passed md “\\?\c:\AnnoyingFolder.” to the command prompt and there! it works like magic.

    One other thing…

    Whenever you create a folder ending with a dot, you can neither access nor delete it.

    Should you however create a folder whose name ends with a space (” “), you can access it like a regular folder but you cannot delete it. In such folders, any subfolder or file you create is *lost* for good. Windows does not recognise its existence.

    Plus, as soon as you create any file or folder in a folder whose name ends with a space, the DOS command, RD, or RMDIR does not work on it nor its contents any more. You’ll have to use the program Unlocker.
    My warning: Do not mess around with folders whose names end with a space or you will be in serious trouble.

    Thanks man. You’ve been of help.

  94. DILLI on

    Thank you Thank you Thank you!!! The unlocker program worked perfect. Thanx once again to all of you and your input

  95. Bill on

    Thank you so much for sharing this solution, Duncan. A worthy contribution to the public good.

  96. SB on

    I have a Firefox bookmark folder named “Car..”, which when imported into IE8 becomes “Car.”! Stupid Microsoft! The imported bookmark folder is neither accessible or deleteable from within IE or Windows Explorer. Thankfully, your solution works for me!

  97. Matt on

    OMG THANK YOU SOOOOOOOO MUCH!!!!!

  98. Dankwa on

    absolutely fantastic. i tried everything to no avail until i found this solution. Thank you very, very much!!!

  99. Mark on

    Thank you Duncan… Two week problem fixed.

  100. ogeday on

    unlocker 1.8.7! i’ve been trying to delete a file for two weeks but now it’s gone. thank you unlocker =)

  101. Haluk Cengiz on

    Thank you Duncan,

    The same problem happened to me yesterday. I used, Chkdsk, Moveonboot and unlocker but they did not help me.

    I never thought that this was that easy. Now I tried and it worked.

    Thanks million times. It is really annoying to have it on your desktop.

  102. A1efBet on

    THANK YOU! The unlocker worked flawlessly and got rid of a folder that ended with a space. It was driving me crazy for over a month!

  103. crinky on

    TYVM (grrrr Mac people!)

    I used rd /s \\?\path and it worked perfectly.

    This page was #1 on my Google search of the error!

    Gotta love the Series of Tubes!!!

  104. Lynne on

    Not working for me: On my Win Server 2000 When I try:D :\data\Scanner\scan>del “ADVISORY SERVICES” I get
    Could Not Find D:\data\Scanner\scan\ADVISORY SERVICES

    Tried the unlocker it gets message of Process not locked, “Object cannot be deleted”
    Grrr…
    These folders are created when someone scans a doc, saving it to the network. It seems that occasionally certain files just wont delete. Any suggestions? tks

  105. BryTech on

    SOLVED: UNREMOVABLE DIRECTORY!

    Ok, so I have a Windows XP machine with a shared folder used by some Mac users. That got me in trouble. Now I have a load of folders I can’t delete, even using the above suggestions. COBIAN BACKUP to the rescue! I use the Cobian Backup utility (free) for other folders and I noticed it successfully removed folders I couldn’t – AND – on the Cobian “Tools” menu, there’s a utility called “Deleter”. You can browse to any folder name on the XP PC, select it, check the box that says “Delete recursively” and away it goes. Those guys RULE! Yeah, maybe installing a backup utility is a little more than you want to do, but it only takes a few minutes and it was soooooo worth the time. FYI, I’m running v.9 of Cobian Backup. Good luck to you all but this worked great for deleting a bunch of Mac-deposited folders!!!

  106. shopkin527 on

    the command line resolution suggested here did not work for me, but the “unlocker” utility did provide a quick and easy install and fix.

    thanks!

  107. Lynne on

    Thanks BryTech! Your solution (after trying many) was the only way I could get these folders to delete!

  108. BryTech on

    No problem. I couldn’t get the folders removed any other way. Even Unlocker wouldn’t do it for me.

  109. Tim on

    Awesome solution, thanks!!

  110. Jayanth on

    Perfect Solution. Thank You.

  111. andrew on

    Thank you so much.

  112. meirav on

    try double-click on the file and open it with Notepad. Then, you will see a message: ” Do you want to create a new file? ” click YES. Then, write something in it few words and click on SAVE. Close Notepad and go to the file again , right click on it and delete. Worked for me. Hope it will work for you…

  113. meirav on

    Actually, it did not work for me at the end so don’t try it. But i downloaded the UNLOCKER and it deleted the files finally.

  114. msknyc on

    Thanks a lot….was finally able to get rid of a troublesome file that’s been makin’ me nuts for the longest=)

  115. Eric on

    worked great for me with a file name that ended with a dot. command prompt lists it’s directory like so
    c:\documents and settings\eric>

    you must remember to use the command cd\ first

    eg. c:\documents and settings\eric>cd\

    press enter and it will now show
    C:\
    now type the file you want to delete and it will look like this:
    C:\ del \\?\c:\documents and settings\eric\desktop\annoyingfile.

  116. Eric on

    example spacing correction
    Only required space is between del and the \\?\ any other spaces are the actual spaces in the directory and file names.

    C:\>del \\?\c:\documents and settings\eric\desktop\annoyingfile.

  117. ian on

    at command line it kept saying it couldn’t find the file, but when I typed (from inside the folder) del awaken~1 it worked great. Use the DOS filename.

  118. scorpio_india69 on

    Thanks a lot !!!

    I had two such cases on my machine. One folder and one file. Both were deleted with no problems.

    Thanks again, and keep the good work going !

  119. Todd on

    You are the best! Thanks!

  120. TheChaim42 on

    Thank you for the command line code! It’s been bothering me for a few weeks and it’s been a VERY long time since I’ve had to use a DOS command line!

  121. Lauren on

    Thanks so much, the little twerps have been annoying me for so long.

  122. Scott on

    Thanks for the elegant solution and to those intrepid commenter’s who where able to fill in the chinks! The last time I had a file like this I reformatted to remove it, this is a darn sight easier!

  123. Hari on

    Thanks for this kool stuff buddy

  124. Nice on

    YAAAAAAAAAAAAHOOOOOOOOOOOOOO!!!!!!!!!

    THANK YOU SOOOO MUUUUUUUCH!!
    YOU ARE A GENIOUS!!!!!!!!

    YEEESS!!!!!!!!

  125. Vekos on

    This works wonderfully.
    For those havin’ trouble typing in the path, click and drag the file name into cmd eg: del “\\?\click and drag the name of your file here and the path will be filled in for you. Use your back arrow on your keyboard and delete the double quotation mark ” that appears before the C: or D: press Enter and yer done.
    Click and drag the name of the folder into cmd if using rd /s “\\?\ remember to delete the quotation mark, press enter, type y for yes then Enter and voila.

  126. bryan on

    Thanks, I waded thru a lot of info and tried several things before I found your solution

  127. ota on

    THANK YOU SO MUCH!!! At last, after several months, I could delete an annoying file thanks to your precious advice. I am really happy and very greatful.
    Ciao from Rome

  128. Alex on

    Thanks a lot, man!!! The del command didn’t work as I’m on WIN XP SP 3 NTFS, but unlocker still helped!!! Many thanks !!! Also for the trick;-)

  129. Greg on

    Thanks for all your input. The Unlocker Assistant, http://ccollomb.free.fr/unlocker worked! I was able to delete two files that I have been trying to delete.

  130. Jason on

    Hi there, I had a problem deleting a folder created by a program — I tried the above but this did not work for me (I have ended up with the folder on a number of drives through syncing) the only way I seem to have been able to get rid of the folder is by booting into Ubuntu by CD and using Linux to get rid of it!

  131. Pearl on

    Hey thanks for the solution! Been looking all over the web for help and you’re the best!

  132. Graham on

    I just tripped over a super simple (that’s me!) solution. Open the fikle with Unlocker 1.8.7, change the pulldown to delete, and bingo….gone.

  133. Mark G on

    Thanks. In my case there was very very very very long file name.

  134. Myk on

    100% working.
    Thank you so much.. :)

  135. Richard G on

    Bingo! (problem solved)

    Much appreciated. Smart stuff! Thank you.

  136. LoTek on

    Duncan. Well played! Solved an issue with a craptasmo file that threatened my very existence. It has been dealt with and life will resume. Tragedy avoided. I like many others feel the wrath of The MAN often and appreciate simple solutions. Now time to catch the 405.

  137. Boatless on

    Duncan, These three files have been on my desktop for years. I was spring cleaning this evening and was bugged one more time by the files mere existence. I stumbled on you solution and it’s genius. I too was told by my IT department there was no way to remove the files and evene if they rebuilt my hard drive there was no GRT they would go away. Hats off to you a million times. I am grateful.

  138. Courtney on

    Duncan, thanks! I’ve had two files stuck in a folder for months that I hadn’t been able to get rid of.

  139. Anurag Anil on

    I am not able to type the recommended command in the “command prompt” as it shows :
    C:\Documents and Settings\username>

    I’ve tried 2 use all “delete” programs..but,they didn’t work.

    The file is on desktop.

    The annoying filename is :
    out_BuBut you love me,Daddy !

    Help needed..DESPERATELY as I luv a clean Desktop.

    If u want..u can mail me.

    But,plzzzzzzzzz ASSIST me.

  140. john on

    Ty for the info…

    At last i deleted that pesky file

  141. Anonymous on

    THANK YOU SOOO MUCH!!!!!!!!!

  142. Anurag on

    I am not able to type the recommended command in the “command prompt” as it shows :
    C:\Documents and Settings\username>

    I’ve tried 2 use all “delete” programs..but,they didn’t work.

    The file is on desktop.

    The annoying filename is :
    out_BuBut you love me,Daddy !

    Help needed..DESPERATELY as I luv a clean Desktop.

    If u want..u can mail me.

    But,plzzzzzzzzz ASSIST me.

  143. Mac on

    My file was on my local disk, not a system file and not hidden. It did appear to have a trailing space in the name. None of the above worked directly, but a variation/combination of posts led me to try this, which worked:

    1. cd to the directory with the bad file
    2. dir /x /a to get the file’s short 8-bit name, say “shortname”
    3. del /a shortname

    No other options on the del command. For example, “del /ahs shortname” did NOT work since the file was not a system or hidden file. I don’t know what the “/a” option is supposed to do without additional specifiers, but it worked for this case.

    @Anurag, in step 1, to cd to your desktop, just type “cd Desktop” from your “C:\Documents and Settings\username>” prompt.

  144. Anurag Anil on

    Thanks,Mac for showin’ concern for my woes..
    Though,due to ineptness of me..it didn’t work.

    But,something DID work..like a magic..after goin’ thru d agony of watchin’ that irritating file’s existence on my desktop:
    http://ccollomb.free.fr/unlocker/

    Amazing..

  145. rajkuma on

    ooooooooohhhhh my goddddd..
    its working…….
    thanks man..
    may god bless you.

  146. ggeorgi on

    Well done man….. I had this “ghost” and looking for solution a month now….. thanks

  147. pae on

    thx a lot….
    >,< this solution is great

  148. Anurag Anil on

    But,something DID work..like a magic..after goin’ thru d agony of watchin’ that irritating file’s existence on my desktop:
    http://ccollomb.free.fr/unlocker/

    Amazing..

  149. diego on

    YOU ARE GOD!

    My God, I was having such a terrible time; look am a maniac, ok, I couldn’t live with this damn file that refused to go away, and you had the seemingly non-existing answer. Thank you!

  150. J on

    Thanks a lot! Worked for me.

  151. rcragun on

    worked for me!!

  152. Brenda on

    gee, thanks a lot! :)

  153. derek on

    Thanks Chola, that worked.

  154. Shawn on

    Again, another big thank you

  155. Basu on

    Thank you very much man

  156. Dave on

    Thank you so much – my server just been hacked with 10gb of s**t – this save my life, many thanks man.

  157. Christopher on

    I was pulling my hair out having tried just about all the standard stuff to remove an annoying directory. This worked like a charm. Thanks!!

  158. Evan on

    Duncan you just rock man! I spent the last 30 mins of my life searching for this issue in google and I’ve found only really stupid suggestions and explanations of this little problem. Until I got to you! Thank you so much :)

  159. 80sBoy on

    Worked like a charm – thanks!

  160. ZoRo on

    Big thanks

  161. Ben on

    You are a legend, thanks alot for taking the time and effort to post this.

  162. luiz on

    thank you. incredible !

  163. da bare on

    you da man!!! and the others that helped you come up with this!!! at work they always call on me to fix computer things and now after searching and finding this for my personal computer, i think i’m gonna have some fun at work with creating files and then deleting them! hehe ;)

  164. Vašek on

    Thank you!

    I suffered for one year with one file/notfile on my Destop (no possibility for change name, delete or move through normal way)

  165. nick on

    didnt work so depressed

  166. RKD on

    Impressive..!

    Finally I got rid of those stupid files on my desktop..

    Thanks VERY much Duncan..

  167. bibie on

    wow…
    thanks a lot duncan..ftr a month, finally i found it. thnks!

  168. Hels bells on

    Fan-bloomin’-tastic!!
    Thanks a million, worked a dream…

  169. Dave on

    Thanks alot for taking the time and effort to post this, tearing my hair out trying to get those damn directories to delete.

  170. woooooo on

    this just saved my life. thaks

  171. Randy on

    Thanks!!! worked great

  172. Stephaen on

    Great! It works also for files with some weird invisible characters (these files came from my Mac at work).

  173. Steve on

    Thanks for that, I had some files with the syntax [file name] at the start of the filename that apparently, windows didn’t recognize. However your solution beautfully deletes them (and creates them too !!) One thing I would add, is that instead of using two “” at the end of each command line, just leave the command as it is untouched after you paste the offending file name. this worked well for me with a multitude of different names.

  174. RP on

    Thanks a MILLION. ‘Unlocker Assistant’ worked. File deleted successfully

    • MWR on

      Thank you.

  175. Dietmar on

    Just had a similar issue with a folder containing a space as last character (”FolderName “). Your tip helped also in this case. Thanks

  176. Kushagra Udai on

    Hi,
    I’m probably the most unfortunate of you all – I’ve got a folder whose name ends with a backslash. I’ve no idea how it got created – I probably copied it off a pendrive, although I can’t imagine which OS would allow this.

    05/17/2009 03:39 PM .
    05/17/2009 03:39 PM ..
    08/18/2007 04:32 PM defective\
    0 File(s) 0 bytes
    3 Dir(s) 11,153,424,384 bytes free

    Thats the folder – please not hat it was called defective because I had kept some incomplete videos in it – NOT because this was intended.
    I’ve tried Unlocker, Delinvfile and all the methods in the comments above – absolutely nothing seems to be able to find the file. And Delinv fileshows its short name also as “defective\”. I’ve no idea how that can possibly be because that is 10 Characters. For some reason /x/a does not seem to show short file names when I use the switches with the dir command in cmd. Any Assistance will greatly appreciated.

  177. mARk on

    Just had a file that ended with a space this worked on the First Try….Thanks

  178. Flushing Turd on

    Found the solution to the file copy problem. It was a firewall setting of AES-128 encryption that was mucking up the copy. Changed it to a lower encryption.

  179. aileverte on

    Thank you! The file that got stuck on my desktop was actually a partially downloaded pdf file, and it didn’t have any extension at all… Tried three different things in the command prompt, and it worked when I added a space to the end of the file name!

  180. Johnny T on

    Thanks! I can get around a puter, but not such a hot shot but this worked easy, way to go bro’!

  181. Scott on

    Thanks! Got rid of a torrent file I couldn’t delete.

  182. piyush on

    hi! i hv a whole folder to delete . i tried using ur suggestion but itsnot happening …. :(
    the file names r strange like “*”, “”
    C:\MetaStock Data\april\
    pls help

  183. Nobody on

    UNBELIEVABLE!!!
    IT WORKS, LIKE A CHARM (TO QUOTE SOME OTHER USERS).
    THANK YOU SO MUCH FOR YOUR TIP, DUNCAN!

  184. Beef on

    Hope this can help: I had 4 files ending with a space. They were flagged system and hidden.
    I couldn’t delete the entire directory because it was my desktop folder!

    The \\?\ trick doesn’t work, because of the H and S flags.

    The /a trick works instead! It works because you don’t need to specify any path (and the ANY filename, right or wrong it is, with ending point o ending spaces: it doesn’t matters). The wildcards and the /a will do the rest.

    del *.* /a (only if it is a simple file)
    del *.* /ash (in my case)

  185. Michael on

    So happy… it worked for me. Thanks a lot for sharing it.

  186. Mohammad on

    use a third party software called “unlocker” to delete the file permanently, here is the link:

    http://ccollomb.free.fr/unlocker/

    that unbelievably worked for me after trying all other useless ways.

    hope it does the same for you

  187. Neal on

    You smart boy Duncan…
    Thanks very much. First I typed in command prompt del “c:Documents and Settings\cinkhede\Desktop\Annoying file you can’t delet
    e.”
    By using TAB key & then added \\?\ before filename.
    Worked fine for me.

  188. Mika on

    Worked beautifully. This is a problem I have been trying to solve on my windows servers for months. Thanks a bunch!

  189. David on

    The file I am trying to delete from my desktop is “CASJQTMT.” Duncan’s solution didn’t work for me. Unlocker did not work either. Any suggestions?

  190. Thank you! on

    wow kickass, this worked!

  191. Karthik.India on

    Thank you. this works perfectly.

  192. Rahamath on

    Thanks Dude. U r great

  193. Alex on

    Thank you very much Duncan! I also inherited a bunch of these files & directories and they were a major eye sore. What a great solution. YOU ROCK!!!

  194. Jacob on

    Thanks for the heads-up. I had a few of these files that came from…….a MAC. But, not anymore. Thanks again!

  195. Alec on

    Hi guys! Normally, I am one from those that only read about such problems without contributing. However, this time, I want to share my experience on how to remove these files and deal with this “cannot delete file cannot read from the source file or disk”
    So, after reading all this conversation, I downloaded the Unlocker (http://ccollomb.free.fr/unlocker/), although full of doubt!
    Simply, I installed it, I right clicked on the files and I deleted them right away!
    So, the most simple way is this Unlocker, if one wants to get rid of these files, stuck on our desktops! (btw, they were .torrent files)

  196. Matt on

    Dude I love you, this file randomly showed up from a torrent and I was worried it was a virus or malware sorta file that wouldn’t delete it self. Glad to see it was not, thanks for the help.

  197. Tuc on

    Worked like a charm, thanks!

  198. Jonez on

    PRECIATE THAT HELP WITH USING THE UNLOCKER PROGRAM, WORKS LIKE A FUKIN CHARM YA DIG!!

  199. loc on

    Excellent, it worked! I was getting so pissed off with these Mac folders on my WinXP machine! Thanks!!

  200. qwerty on

    RMDIR! THANKyou thankyouthankyou!

  201. Bgr on

    Oh great! been hunting for this! thanks works flawlessly on XP64!

  202. bala on

    THANKS A TON.

    I broke my head for several days on this.

  203. cecileva on

    Thanks for this, worked like a charm for me too. It was also a “buddy file” for a word doc that I received from a correspondant on a mac.

  204. Ennev on

    Thanks such folder where stuck one of our servers, this really fixed the problem. Since the volume was on a raid 5 i doubted it was a bad sector.

    Thanks again !

  205. Racan Aboredaif on

    i have tried every thing but nothing seems to work. it doesnt seem to recongise the file at all. the size is zero.

    i keep getting msgs like this when in dos:

    1. the file name, directory name or volume label syntax is incorrect

    2. couldnt find ….etc

  206. Keksich on

    My folder I want to delete doesn’t have 8-bit name. Other folders do, but this one has just empty space.

  207. Keksich on

    Unlocker doesn’t help either.

  208. Keksich on

    (Yes, I run SP3)

  209. Joel on

    Thank you so much for the help! I’ve been struggling with a folder for a while. No longer.

  210. Keksich on

    Solved it! Opened Nero BackItUp ImageTool and deleted it from there ^^


Leave a reply