Windows file name(s) are too long

I wanted to delete some Windows 8 store cache files but an error came up when I tried to delete them from Explorer.

I found a cool way to get around this as Windows have a limitation of not just file name length but it includes the file path. If I remember correctly the full path including the file name cannot be longer than 255 characters (this may have changed with Windows 7/8).

A tip I found on superuser website was to mount a drive at the parent folder:
Run
Start > Run > “cmd” and press enter (no quotes)

Go to the parent directory where the files are that should be removed.

In the parent folder type in:
subst j: .
where j: is the drive letter to assign.

Go back to This PC (My Computer or Computer) and there will be a new drive with the letter from above command.

Delete the files that are too long.

Go back to the command line and remove the new drive:
subst /d j:

How to delete a file with a path too long to be deleted [duplicate]

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Windows and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.