Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question has been asked, but unfortunately none of the suggestions worked.

Here is the situation--the file is synced to a local folder on my computer in my /users folder from Google Drive. It is a pdf (looks like a saved receipt from somewhere). The name is >255 characters which throws Windows off.

What the file will not do

  • Open
  • Copy
  • Rename
  • Move
  • Paste
  • show properties

Actually I have not gotten the file to provide any sort of response besides the same error at all.

Solutions tried:

  • dir /x --no shortname is listed, it simply repeats the regular name.
  • Using FileBoss, Explorer++, 7zip
  • rmdir /S /Q <dir> doesn't really work since it is in my user folder...

If anyone has an idea to try, I'd be open to it.

Edit--In this instance the file name itself is greater than 255 characters. Changing the directories it is nested in will not affect the problem since there is no issue with the file path. (This problem in itself eliminates many other solutions).

share|improve this question
Have you tried all the solutions suggested? You listed three. Out of well over a dozen. For example, UNC paths should work. – Bob Jun 10 '13 at 5:56
You write you tried rename; did you also try a wildcard rename? ren *.ex1 short.ex2 [And i assume you made a typo in your question, it says '<255' instead of '>255'] – Jan Doggen Jun 10 '13 at 6:40
If you are able to write a little program to do the rename you could try the \\?\ trick mentioned in… – Jan Doggen Jun 10 '13 at 6:45
Possible duplicate of… Here it suggest "renaming the containing folder name(s)" so that eventually the full file spec is shorter than 255 – Jan Doggen Jun 10 '13 at 6:47
Not to mention the many results Googling for "rename windows long file name 255"... – Jan Doggen Jun 10 '13 at 6:48
up vote 2 down vote accepted

I would boot into a Linux Live Disc, mount your Windows drive and remove it using Linux/Unix.

I think the main commands you would need are:

mount -t ntfs-3g /dev/sdX# /mnt
cd /mnt/Users/You
rm -f further/loc/away.filename

(Note: you may need to run fdisk -l to locate your Windows partition)

and that should get you there. I had to do that at some point in time as well.

share|improve this answer
This worked for me. Thanks for the suggestion, I booted to PartedMagic, and had no problems. This is the easiest solution by far. – iamwpj Jun 14 '13 at 23:37

On Windows simply use the 7z file manager or any other explorer(-like) application that uses Unicode versions of API for file handling. Duplicates and further information:

(1) Technical background of the issue: The MAX_PATH limit (see also (4)).

(2) How to overcome this limit on a programmer level.

(3) How to overcome this limit on a user level.

Please be aware that (3) is ONLY a workaround. It is by no means in any way suitable for programming. The worst part is that the guys at Microsoft are mixing APIs which may lead a fully UNC-path-compatible application back to 260-MaxPath-StoneAge because of only one call to an incompatible API (cf. (2)). The Explorer and other products (including cmd & powershell) from Microsoft may never overcome this issue due to their history (the votings under the links for eliminating the limit are either ignored or declined).

Depending on the use case and version the limit seems to vary. Windows 8 Explorer seems to be able to handle around 4 times longer paths (4) whereas from Windows 7 onwards the longest file path allowed to be moved to the Recycle Bin decreased from 259 to 215 (5). Why the programmers starting from scratch with Windows NT didn't implement a dynamical allocation remains a riddle. An approach for todays situation using Non-Unicode API is described here(copy).

Other topics related to programming and UNC paths in the SO-network:

6 UNC paths in Java and its realization on JVM level.

7 & 8 UNC paths in networking.

Cases I came across where this limit is really annoying:

  • Organizing source code hierarchies: nodeJS

  • Backing up files in deep nested folder structures

  • Naming convention for documents (e.g. papers which have a long description - Abstract, Authors, Title, DOI - as their name for rapid search and find)

  • Sharing files between Linux (which doesn't have this limit) and Windows

share|improve this answer

You might want to try to take ownership of the file and see if you're able to delete it. You can do this by right-clicking the file: Properties -> Security -> Advanced -> Owner -> Edit and then change owner to your username (or Administrators group).

For more information, check this out.

share|improve this answer
Thanks, but I cannot view properties of the file. – iamwpj Jun 12 '13 at 3:24
@iamwpj What error do you get when you try to view the properties of this file? – Muneeb M Jun 13 '13 at 7:33
None, there is no option to view properties. The file is entire inaccessible. – iamwpj Jun 14 '13 at 15:38

This is what worked for me in a similar situation:

First attempted this to take ownership:

takeown /r /d y /f my_folder

This didn't work for some files. Then I used cygwin which I already had installed and simple ran:

rm -rf path/to/my_folder

Voila, gone.

share|improve this answer

You must log in to answer this question.

protected by bwDraco Mar 6 at 4:39

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .