cannot delete a folder "filename you specified is invalid or too long. specify a different filename"

0

I have a folder called "io" in my computer hard disk drive D: .

Screenshot of io

Since its an unnecessary folder I try to right click and delete then I'm getting following message and cannot delete it.

the filename you specified is invalid or too long. specify a different filename

Screenshot of error

then I try to delete using windows command line and using following code

del /S D:\io\*

then getting following error

Screenshot of error

According to this question I followed top answers of that but none of the thing worked for me

  1. Downloaded and installed 7-zip and same error getting

  2. used following command too

    rmdir /S /Q <dir>

here the result then

Screenshot of error

Kelum Priyadarshane

Posted 2015-11-08T14:20:03.577

Reputation: 111

3

Possible duplicate of How to delete directories with path/names too long for normal delete

– DavidPostill – 2015-11-08T14:24:30.840

@DavidPostill I downloaded and install 7-Zip that solution not working for me , same error message getting – Kelum Priyadarshane – 2015-11-08T14:33:24.263

<shrug> Did you try the other 19 answers in the duplicate? – DavidPostill – 2015-11-08T14:36:26.840

I had this very problem with a file, I tried the solutions in the duplicate given by David but to no avail. Then I booted my win 7 into safemode and tried to delete it, but failed again. To my surprise, when I rebooted my pc the file is gone. You could give this a try :) – RogUE – 2015-11-08T14:39:23.797

@DavidPostill its only have 15 answers – Kelum Priyadarshane – 2015-11-08T14:42:49.927

@kelumpriyadarshane 4 of the answers were deleted as spam. That still leaves 15 for you to try ;) – DavidPostill – 2015-11-08T14:44:15.177

Answers

1

Yes I able to find the solution myself

using Ubuntu or any other Linux Bootable CD we can boot our computer to Ubuntu or any other OS for temporary.

then we can select the folder and we can delete it easily.

Kelum Priyadarshane

Posted 2015-11-08T14:20:03.577

Reputation: 111

2

The problem is that you folder is placed under many nested folders and you just crossed the 260 character limit.

Try moving the folder(you want to delete) one directory up. What I mean to say is use Ctrl-X on folder for cut command, then press backspace to go one level up and paste it here using Ctrl-V. Do it until you are not able to delete it.

Let me know if this helps..

jsk5755

Posted 2015-11-08T14:20:03.577

Reputation: 61

This worked for me on several occasions, moving or renaming a parent folder to a shorter name/location will allow the file to be deleted/changed. – Cand3r – 2015-12-11T13:46:46.273