none
Unable to Delete Folder, Could not find this item

    Question

  • Currently, I'm having problem deleting an old Folder. Previously, I used its parent as a shared folder, but one day when I tried to clear that folder there is one folder that has duplicate. The problem is one of them (the old one) can't be deleted even after I deleted all files/folders in that folder, I can't remove/rename that folder (could not find this item) not even with cmd as Administrator. I've tried to defrag my Windows Sever 2012 but the problem still persists. How to fix this problem?

    Thanks in advance.

    Tuesday, June 11, 2013 1:43 PM

Answers

  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    Friday, August 02, 2013 7:34 AM

All replies

  • 1) go to folder security option, check for your username, if it is not there then add, then try to delete.

    OR

    2) take ownership of folder, then try,

    3) check what permission you have on system. 


    Prashant M

    Tuesday, June 11, 2013 4:17 PM
  • 1) go to folder security option, check for your username, if it is not there then add, then try to delete.

    OR

    2) take ownership of folder, then try,

    3) check what permission you have on system. 


    Prashant M

    Here is the screen shoot of the folder security:

    How to fix this problem?

    Thanks in advance.

    Tuesday, June 11, 2013 4:29 PM
  • Hi ,

    can you use Icacls to verify the status of the folder - I am particularly interested in the display message of the icacls

    are you able to perform any other folder related stuff

    eg: create subfolder within this folder

          or move this folder to different location and try deleting it ?

    If the above doesn't work , we need to verify for the sticky hard lock using procmon and delete the dependent GUID.

    Wednesday, June 12, 2013 1:54 AM
  • I have met this problem several times on Windows OS. I was run scandisk utility then error folders will be deleted automaticaly. Try it! hope this help
    Wednesday, June 12, 2013 9:30 AM
  • Hi ,

    can you use Icacls to verify the status of the folder - I am particularly interested in the display message of the icacls

    are you able to perform any other folder related stuff

    eg: create subfolder within this folder

          or move this folder to different location and try deleting it ?

    If the above doesn't work , we need to verify for the sticky hard lock using procmon and delete the dependent GUID.


    I've tried to move it, but the error is the same (Couldn't find this item).
    Wednesday, June 12, 2013 12:47 PM
  • I have met this problem several times on Windows OS. I was run scandisk utility then error folders will be deleted automaticaly. Try it! hope this help

    This solution isn't working.
    Wednesday, June 12, 2013 12:47 PM
  • Refer below link,  that may help you,

    http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/92da4ca9-fc6d-4de7-bcf8-288100129e22


    Prashant M


    I'm sorry, the solution isn't working.
    Wednesday, June 12, 2013 1:56 PM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    Friday, August 02, 2013 7:34 AM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    I've had a similar problem as detailed above; a power shell script that I wrote incorrectly tested for the existence of a directory and created multiple instances of the same directory.

    I can confirm that the post from Rayza73 works like a charm!

    @Rayza73:  First up thanks for the information.  Would it be possible for you to describe how the command is able to find and delete the directory?

    Many thanks

    Shaun

    Monday, September 30, 2013 10:23 AM
  • I had same issue, and this was the fix. Thanks Rayza73!
    Sunday, October 13, 2013 8:01 PM
  • Worked like a charm.  Thank you, Rayza73!
    Thursday, December 05, 2013 2:58 AM
  • Fantastic! Had same problem, but this solution worked (once I typed the pathname correctly!)

    Thanks!

    Tuesday, December 10, 2013 9:53 AM
  • Same issue on Windows 8.1, fix worked great after several attempts and reading very carefully.  Space at end required and that "\\?\" is weird.  Thanks.
    Thursday, December 12, 2013 2:43 AM
  • rd /s "\\?\D:\Sharedata\folder1\folder2 "

    This is the only way it works with me, also I tried just type the folder name and it doesn't delete the file, you have to insert the whole path in the command.

    Wednesday, January 22, 2014 12:40 AM
  • like Rayza73 said, it will delete the folder . thanks Rayza73, me too got the same problem a few months ago! :)
    • Edited by lilswiftzz Thursday, February 06, 2014 9:50 AM
    Thursday, February 06, 2014 9:49 AM
  • Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    Amazing what one finds when one knows what to look for.  Ran in to this problem just this week.  Was causing warnings for incomplete backups.  Followed Rayza73's guidance, and sure enough....a space at the end of the folder name.  Ran the command and presto - no more folder.

    Sweet find Rayza, and thanks for posting.

    • Proposed as answer by MrTech86 Monday, September 15, 2014 4:00 AM
    Tuesday, February 11, 2014 6:47 PM
  • Awesome. I just had this problem and it was driving me batty. Thanks Rayza73!
    Wednesday, February 12, 2014 3:12 PM
  • You my friend are a genius thanks rayza
    Friday, February 14, 2014 11:15 AM
  • Got this problem after I joined a domain and had to get rid of an old User folder.  I tried every work around I know but did not work.  Rayza73 solution worked.  Thanks.

    Thursday, March 06, 2014 9:47 AM
  • Use this tool and delete 

    http://fs32.filehippo.com/1431/0ca49414cc7f438aaaf64c12dbb38dc0/Unlocker1.9.2.exe

    Saturday, May 10, 2014 2:25 PM
  • Thank you so very much for this answer.  Not being able to delete the folder was driving me nuts and I couldn't figure it out.

    Thanks again!

    • Proposed as answer by rollerboogie Monday, July 28, 2014 5:37 PM
    • Unproposed as answer by rollerboogie Monday, July 28, 2014 5:37 PM
    Wednesday, June 25, 2014 10:42 AM
  • Thanks Rayza73! Worked like a charm!
    Monday, July 28, 2014 5:38 PM
  • Hi,

    This is Amazing, works like a charm.

    It would be great if you could explain how this works.!!!!

    Thank you so much.

    Thursday, August 21, 2014 2:34 PM
  • Thanks to Rayza73!

    I was searching for the solution.....

    it worked !

    Monday, September 22, 2014 3:37 PM
  • The solution from Rayza73 worked for me as well. Can someone please explain me what does \\?\ mean?
    Monday, September 22, 2014 6:05 PM
  • I been working with computers a very long time and I had never use this \\?\ combination,  it works 

    Thanks you

    Saturday, September 27, 2014 2:20 PM
  • Many thanks for this fix, worked like a charm for me on Windows 7 64bit Home Edition.
    Sunday, October 19, 2014 6:25 PM
  • Thanks a lot, Rayza73,

    I struggled for many months with this error. You got it!

    Regards,

    kcy

    Wednesday, November 12, 2014 10:51 PM
  • Thank you so much for this, worked a charm as soon as I got the command correct in CMD. 
    Saturday, December 13, 2014 5:20 PM
  • Thank you so very much. That folder had been aggravating me for far to long.
    Monday, December 15, 2014 10:31 PM
  • Amazing.  I've been looking for a solution to get rid of an empty "windows.old" folder for a long while.  This single command took care of it in barely a second.  Thanks.
    Wednesday, December 31, 2014 3:27 PM
  • Genius, been trying as everyone else in this thread to resolve this issue. This worked on server 2003, windows 7, and server 2008 R2.
    Wednesday, January 28, 2015 3:14 PM
  • Excellent solution Rayza73 and thanks for posting. This worked great when trying to delete a down level folder in an old user account in Windows 7.
    Sunday, February 01, 2015 5:33 PM
  • Brilliant, Thank you Rayza.
    Tuesday, February 03, 2015 12:00 PM
  • Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    I had the same problem and your solution just worked. Thank you!

    Monday, February 09, 2015 12:06 AM
  • Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    Brilliant solution. Worked like a charm. Thank you so much Rayza.
    Tuesday, February 10, 2015 11:52 PM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me


    Thank you, this worked for me : )
    Saturday, March 07, 2015 12:55 PM
  • Rayza73's solution works like a charm indeed but has it's limits.

    This will not work if you try to delete the parent folder to multiple bad files.

    If there are multiple bad files in the same folder, you will have to apply this method repeatedly to each bad file before you can delete the parent folder.

    I had to do this to 3 bad files left from software I removed.

    Tuesday, March 17, 2015 4:29 AM
  • (Exactly what I had used...) [sic] rd /s "\\?\C:\Users\RmR\Desktop\Carach Angren - Lammendam"

    Here is what I started with, having not worked was...rd /s "\\?\C:\Users\RmR\Desktop\Carach Angren - Lammendam "

    Conclusion: every little space counts -- additively, use command prompt, and not 'Run' CMD prompter; just a head's up for those who are unfamiliar with BIOS related conceptions.

           Much like a former commentator, I've been working with computers for years -- never have I used this solution, never having considered such a thing -- but it works perfectly, because it overrides legitimate system and illicit-systemic commands and/or firmware -- in which could be derived of virus's, ad-ware and computer overheating (thermal shutdown.)  

    I used this in college once before, to delete an unnecessary folder on the desktop (to make room for my beautiful wallpaper), however, I hadn't remembered what I did -- so I found this page; much to my dismay, I didn't think I would find anything of beneficence on a Microsoft website...sure enough, I was wrong.  Thank you (contributors and problem-solvers), hopefully one day I can repay this debt with l33t ha3xors ski11s and advice.

    Wishing you and yours the best...

    Sincerely, J - A. Eder;


    • Edited by Darkly Origins Saturday, April 11, 2015 9:36 PM ?
    • Proposed as answer by Astral Tim Monday, April 13, 2015 1:17 AM
    Saturday, April 11, 2015 9:34 PM
  • Thanks for this!  It worked great!  I had a folder that simply wouldn't delete.  I would try to delete it via the traditional delete process and received a message indicating it couldn't be found. I tried "BleachBit" and received an error.  I then applied your fix in DOS as Administrator:

    rd /s "\\?\D:\DATA\B"  (The bad directory folder that I wanted to delete was "D:\DATA\B" or the "B" folder in the "DATA" directory of drive "D". ) There were several other empty folders inside the "B" folder with a directory structure that never seemed to end.  I will certainly keep this tip for my records.  Greatly appreciated!    Buy Roboform Here!


    Monday, April 13, 2015 1:11 AM
  • Thanks !!! That one works
    Wednesday, April 15, 2015 7:55 AM
  • Thanks rayza, this worked! I had this problem on Windows 8.1. Glad I found your post.
    Sunday, April 26, 2015 11:47 AM
  • More than thanx a looot to you!! god bless you!!
    Thursday, April 30, 2015 8:18 PM
  • Thank You Rayza73! You are a life saver!
    Wednesday, May 06, 2015 6:13 PM
  • Thanks, work for me!
    Tuesday, May 12, 2015 10:58 PM
  • Worked like a charm dude. Awsome.

    ran

    Saturday, May 23, 2015 3:41 PM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    Tried this but didn't work for me. When I try to delete the bad folder, I get an error "The system could not find the file specified." And it lists a .nfo file inside this folder. If I try the command on the file itself, I get the same error. This is in WHS2011. Can anyone help me?



    • Edited by Someboody Thursday, May 28, 2015 3:57 AM
    • Proposed as answer by Blackberries Thursday, June 04, 2015 8:50 AM
    • Unproposed as answer by Blackberries Thursday, June 04, 2015 8:51 AM
    Thursday, May 28, 2015 3:28 AM
  • Please try the following:

    http://www.sevenforums.com/tutorials/79699-undeletable-file-delete.html

    It worked for the same problem in my computer running on Win 7.

    Thursday, June 04, 2015 8:51 AM
  • Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    THANKS Rayza73!!! It worked!  Note to others... you must leave the \\?\ in the command and include the space at the end!
    Thursday, June 18, 2015 2:47 PM
  • Didn't work until I put a space at the end before end quotes. Thanks!
    Saturday, July 25, 2015 12:04 AM
  • Your right, thanks mate. Unlocker worked perfect and easier than using command lines. fyi to all when using Unlocker, click drop down menu and select delete

    Thank you Naresh!!!


    • Edited by six_tymes Saturday, September 05, 2015 5:49 AM
    Saturday, September 05, 2015 5:49 AM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me


    Brilliant! I have been trying to delete a folder that does not exist according to Windows for ages and your suggestion worked perfectly. Many thanks
    Wednesday, September 09, 2015 3:32 PM
  • Old post I know but this one helpen me removing the last Windows 7 leftovers while upgrading tot Windows 10.
    Wednesday, September 23, 2015 1:03 PM
  • Thanks Rayza73. Your solution worked like a charm for me. Thanks again.
    Saturday, September 26, 2015 7:09 PM
  • Open Win rar browse the files/foldersyou want to delete  just rename it by right clicking option then delete it after renaming………..good luck..
    • Proposed as answer by deletefile Wednesday, December 30, 2015 6:50 PM
    Friday, October 23, 2015 2:49 PM
  • Thank you so much!

    I tried so many fixes. Even deleting it through other CMD opitions, downloading file-shredders, and restarting in Safe Mode.

    THIS IS THE BEST FIX WHEN NOTHING ELSE WORKS.
    • Edited by Krisna K Monday, November 02, 2015 8:03 AM
    Monday, November 02, 2015 8:03 AM
  • Thanks This worked for me.
    • Proposed as answer by RobKeem Wednesday, November 18, 2015 9:17 PM
    Wednesday, November 18, 2015 9:16 PM
  • First off, I'd like to thank Rayza73 for posting the solution to this issue.

    I had a folder that showed 0 bytes in size, on my desktop for the past 3 months (and me trying to get rid of it for the whole time) and everything I tried failed, until I found Rayza73's solution!!

    THANK YOU!!

    Wednesday, December 02, 2015 2:27 AM
  • Thanks! Best answer.
    Wednesday, December 30, 2015 6:49 PM
  • I followed this and it worked on my Windows SBS-2011 (Windows Server 2008r2). I have the folder that's empty and it was previously used for temporary exchange backup dump.
    Tuesday, January 19, 2016 3:17 AM
  • Thanks, Rayza73!  I've been looking long and hard for a solution to this issue.  Still trying to figure out the "\\?" mojo, can someone explain what this is doing for the command?
    Monday, February 01, 2016 2:58 PM
  • Your rd /s "\\?\D:\bad\folder\path " suggestion worked for me.

    The folder in question was something left over from a DFS Replication.  I was removing an old DfsPrivate folder.

    I was able to remove everything but 1 folder which had a GUID in it and was in the ConflictedAndDeleted subfolder.

    Friday, February 12, 2016 5:06 PM
  • Whew! Just like everyone else. I locked up some folders using bad robocopy syntax and was about to hit the bottle hard.  Then I dug a long time online to find the fix. This wiped it. Thanks Rayza. I'm just curious how it works now. LOL.
    Saturday, February 13, 2016 1:17 AM
  • Try downloading IOBIT. If you download it, there are tabs on the top of the application. Go to toolbox and download empty folder scanner. Once its scanned, you have an option to delete it. Select it and delete it. Done! BTW, you need an actual empty folder in order to do this.)

    Sunday, March 20, 2016 6:55 PM
  • rd /s "\\?\D:\bad\folder\path "

    Worked like a charm first try!!!    THANKS!

    Friday, April 08, 2016 3:59 PM
  • Took me a second. 

    This might help you guys, give it a try.

    Step by step:

    1. press windows key + r
    2. type cmd.exe, press enter
    3. cd \to\the\folder\containing\the\problem\file
    4. dir /x
    5. Note the short filename of the problem file. It will look for example like BLAH~1.
    6. del BLAH~1



    • Edited by Ace0197 Thursday, May 12, 2016 9:36 AM
    Thursday, May 12, 2016 9:35 AM
  • Awesome! Solved my problem on Window 2012 R2. Thanks.
    Saturday, June 11, 2016 5:42 AM
  • Just awesome!  This worked for me three years later in Vista, and I thank you most sincerely.

    Tuesday, July 05, 2016 2:16 AM
  • You deserve a statue! Thanks!
    Tuesday, August 02, 2016 12:30 PM
  • Thank you Rayza73, had this issue and it worked for me on Win 10 machine.  Thanks again.
    Monday, September 12, 2016 1:18 AM
  • Guys,

    Those whom could not get it fixed, please use RMDIR /S to delete the folder(director) and its contents files (make sure your dont need the files inside the folder).

    Wednesday, September 14, 2016 9:12 AM
  • This worked for me, tnx alot for the solution
    Thursday, November 17, 2016 9:47 AM
  • Awesome! This was the only solution to work for me as well. Thank you so much for your answer!
    Thursday, December 22, 2016 4:22 PM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me


    Thanks for this!!!!  I've been fighting this issue for years.  Friggen OSX allows file names with periods and spaces at the end.  Not to mention other funky characters.  Clearly an SMB issue on their end.  In some cases I had to sacrifice the parent folder but this finally cleaned up all that garbage.  I find it odd that DFS is able to replicate these items as well a delete them with no issue.  Thanks again!
    Friday, January 06, 2017 7:45 PM
  • I had a folder , in the Videos folder, that would not delete and I could not delete the folder within either until I tried this.

    After using the CMD process above to remove the folder I needed to reboot. Everything came back fine and the problem folder was GONE!!!

    Worked Perfectly!!! Thanks.

    Wednesday, January 11, 2017 12:56 AM
  • Try to relocate your folder instead of deleting it off! I have done the same! CUT and Paste somewhere else!
    Tuesday, February 07, 2017 3:40 PM
  • I've been searching the web for 2 days now, tried a lof of methods but none of them worked, then I found your solution. Thank you very much!
    Wednesday, February 15, 2017 2:29 PM
  • I can also confirm that Rayza73's solution worked like a charm when nothing else did.
    Saturday, February 18, 2017 5:45 PM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    Thanks! this was the only solution that worked for me.
    Sunday, February 19, 2017 9:15 AM
  • It worked for me. Thank you Rayza73.
    Thursday, March 02, 2017 8:04 PM
  • This one worked for me. Thanks!
    Tuesday, March 21, 2017 8:22 PM
  • This worked for me as well -thanks Rayza73

    Saturday, April 01, 2017 5:05 PM
  • That worked for me too. There was a space at the end of the folder name. Thanks Rayza73.
    Wednesday, April 12, 2017 3:16 PM
  • I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:

    Open CMD and then type:

    rd /s "\\?\D:\bad\folder\path "

    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.

    This worked for me

    Worked for me too.  Saved me from copying ~5TB to another drive, formatting the drive with the problem folder, and the copying everything back.  THANK YOU, Rayza73!  :D
    Tuesday, April 18, 2017 6:53 AM
  • I had exactly the same problem and your solution helped. Thanks a lot. 
    Thursday, April 20, 2017 3:40 PM
  • I had this occur while converting an .ogg file to a .wav file. A duplicate folder was created and the wav file was mirrored in both folders. All other files in the original folder disappeared. I deleted the .wav file in the duplicate folder and the other files in the original folder reappeared. I made sure the files were safe and deleted the original folder and the contents of the duplicate folder. However, I couldn't delete the duplicate folder itself. Windows couldn't find it.

    I used Rayza73's method and it worked like a charm. Scandisk didn't fix it.

    Thanks Rayza73.

    Monday, April 24, 2017 7:43 PM
  • Hi Steve,

    Im writing to you since other posts are fairly old. I wish to use Rayzas method to delete an old folder but dont understand exactly what to do;

    Do I just paste this rd /s "\\?\D:\bad\folder\path " in a command prompt? It doesnt work, wont find a folder which seams reasonable. Should I replace some words in this command or add the actual folders name?

    Help if you dont mind.

    Cheers

    Tuesday, May 09, 2017 5:12 PM
  • This worked for me excluding the space at the end, thanks.
    Saturday, May 13, 2017 3:32 PM
  • Thanks Rayza73 for this solution :)

    Worked for me on a Server 2012 R2.

    Thursday, June 22, 2017 2:04 PM
  • Thanks for the solution. Funnily it didn't work in a Powershell, only in CMD.
    Friday, July 28, 2017 10:07 AM
  • Unfortunately this did not work for me.  The file name started with a square bracket, and thinking this might be part of the problem I tried

    del "[

    followed by the tab key. This brought up the file in question with a trailing space, terminated  correctly by the " character, but when I pressed enter, I got the same old message

    Could Not Find C:\a\b\c\[filename

    In my case dir /x had blank in the position of the 8.3 name as per the explanation in dir /?
    • Edited by clairmatin Saturday, July 29, 2017 12:46 PM added line
    Saturday, July 29, 2017 12:40 PM
  • Thanks!! this worked for me!!!
    Saturday, August 12, 2017 7:37 PM
  • AWESOME!  So for me, I actually couldn't tag the problem folder directly, which was buried deep in the Windows.Old directory, a folder called "LocalState.."  I had to move up a folder and force recursion, which surprisingly worked.

    To my surprise, I couldn't even create a folder that had ".." in the name to show up in Explorer that way.  I couldn't change the security (the OS kept saying it doesn't exist) even on a higher level folder to apply down.

    For troubleshooting, I was able to rename all the higher level folders, so I ended up having a path of:

    c:\Windows.Old\ja\a\L\P\M\LocalState..

    rd'ing that entire path failed with:

    rd : Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory

    names, as in "a..b".
    At line:1 char:1
    + rd "\\?\\C:\Windows.Old\U\ja\a\L\P\M\LocalState.."
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (\\?\\C:\Windows.Old\U\ja\a\L\P\M:String) [Remove-Item], ArgumentExcept
       ion
        + FullyQualifiedErrorId : DirArgumentError,Microsoft.PowerShell.Commands.RemoveItemCommand

    But moving up one folder to 'M' worked.

    EDIT:

    To note, PowerShell could display the folder "LocalState.." with an 'ls' command, but when you tried to 'cd {tab}', or any command that would tab-pull the directory/file, it wouldn't pull anything at all.


    • Edited by JimmyITCS Sunday, August 13, 2017 3:51 PM A little more detail
    Sunday, August 13, 2017 3:48 PM