support.microsoft.com

You Can’t Delete a File Because The Damn Path is Too Bloody Long!

Posted on

About 2 years ago I ran into a faculty member that was a Mac user who was using our file share system (Windows Servers 2008+) to save copies of research.

Research is the difference between tenure and oblivion for faculty at a ‘research’ university.

As is typical with Mac users, the professor was unaware of any limitations in the tiny bubble of “unlimited potential” that makes up the general Apple illusion.  I say ‘Apple illusion’ because I was shocked to find out that MacOS X has very similar limitations.  I should note here that those involved with media (marketing, advertising, graphics artists, etc.) are also guilty of nesting stuff dozens of folders deep.  I honestly think those right-brained people are desperately trying to emulate the left-brained propensity for analytic organization.

In this case, the professor nested folders upon folders until they had gone way beyond the NTFS limitation of 260 characters and because of that, it was saved but could not read or deleted by Windows.

Here’s an EASY way to retrieve the file(s) as per Microsoft Knowledge Base Article 320081:  Start at the beginning of the path and start renaming a few of the long-winded directory names until the path is under 255 characters.  Once you’ve done that, the file(s) are easily moved into a sane folder (directory) structure.

Example:

  • Original path: d:\ProjectAlpha\SillyLongNameForAFolder\Hambone\FruitlessComputerEndeavors\GoingToNeedToFindAnotherJob\NoOneWillHireAnIdiotThatAllowsThisToHappen\MonsterDotCom\file.txt ...for 255+ characters.
  • New, renamed path: d:\pa\slnfaf\h\fce\gtntfaj\nowhaitatth\mdc\file.txt  …etc., until the path is less than 225 characters…then go retrieve the file.

If you have a ton of files, then you can write a PowerShell script that renames each successive folder by the first 1 or 2 letters of the directory.  There are also a few utilities out there that will do this for you.  So if you wanna download some malware or foistware with the utility, go for it.

Remember: the directory structure itself may be the only identification of what the file actually contains!

Example:

  • d:\ServerLogs\FileServers\Dogbert\SecurityLogs\Previous\log.txt
  • d:\ServerLogs\FileServers\Dogbert\SecurityLogs\Current\log.txt

…but by renaming them without keeping track of what the file was exactly, you just screwed yourself big-time:

  • d:\s\f\d\s\c\log.txt
  • d:\s\f\d\s\p\log.txt

Although you get it that it’s a log file, what kind of log is it and to what system or application does it apply to?

Now apply this idea to someone’s research:

  • d:\AustrianEconomicsSeminar\2012\Research\vonMises\1920-1946\biography.docx
  • d:\AES\2012\R\vM\1920-1940\biography.docx

See?  …You’re screwed and that faculty member/customer will NEVER trust you again. <smile>

For me, I prefer the LSD method: Long, Slow & Deliberate. So take your time, work with one file at a time and work closely with the customer.  …you’re talking about a faculty member’s phony-baloney job here!

B$

Advertisements