How to delete a very long filename

B

Boatguy

Somehow when I created a folder, it created a folder within a folder within
a folder, ad nauseum, all with the same name. See below in ( ). I am unable
to delete this (these) folders because of a long file name. I cannot copy,
edit, rename or move any of the files in the last folder. I don't know how
this happened, everything else is normal.
Here is the file name. ( D:\VIP\08 022\08 022\08 022\08 022\08 022\08 022\08
022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08
022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08
022\08 022\08 022\08 022\08 022\PI)

Is there someway to delete this folder?
Boatguy
 
R

Rob Stow

Boatguy said:
Somehow when I created a folder, it created a folder within a folder within
a folder, ad nauseum, all with the same name. See below in ( ). I am unable
to delete this (these) folders because of a long file name. I cannot copy,
edit, rename or move any of the files in the last folder. I don't know how
this happened, everything else is normal.
Here is the file name. ( D:\VIP\08 022\08 022\08 022\08 022\08 022\08 022\08
022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08
022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08 022\08
022\08 022\08 022\08 022\08 022\PI)

Is there someway to delete this folder?
Boatguy

The simple way
rd /s /q "D:\VIP\08 022"
won't work because the path is too long.

Hence you need to rename all of the "08 022" folders
with a little batch file:
CD /D D:\VIP
:Loop
if not exist "08 022" goto :EOF
rename "08 022" 8
cd 8
goto :Loop

Now you can do something like
rd /s /q D:\VIP\8
 
B

Boatguy

Rename did it.Thankew!!
Boatguy
Rob Stow said:
The simple way
rd /s /q "D:\VIP\08 022"
won't work because the path is too long.

Hence you need to rename all of the "08 022" folders
with a little batch file:
CD /D D:\VIP
:Loop
if not exist "08 022" goto :EOF
rename "08 022" 8
cd 8
goto :Loop

Now you can do something like
rd /s /q D:\VIP\8
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top