Veeeeeeerrrrrryyyyy long paths and filenames
-
All Windows based.
I am so fed up with people who write novels in the input box for a filename or folder.
I import data for legal analysis almost daily and the number of times I have to deal with long folder paths and file names is really frustrating.
I either spend 30-120 minutes shortening paths by hand, or writing scripts to try and do it, but you can't really account for all the funny business that people come up with.
I just finished working through a little over 10 million files that had an average path and name of 210 chars. That means for every path and file that was 2 chars, I had one that was over 512 chars. My head hurts.
Has anyone ever encountered a utility to fix this? any ideas?
Of course the real underlying questions is: How the hell did they do it if Windows objects? (Later, when I try to move them!)
-
One of the biggest tools you can use is User Education. Long file names will make backups fail. If you are in the legal realm, the users must be educated that they are causing issues that will make your business fail, clients lose the case, and on some level - worse.
-
I come cross this from time to time, luckily the document and folder doesn't need to be kept.
I rename the document to '1' and the folder '1', this obviously shortens things greatly.
Maybe you could come up with a clever script that just renames things automatically for you?
Deltree used to work for this.
-
Besides educating your users, you might be able set restrictions for file and folder naming length using File Server Resource Manager.
-
-
Quick fix is to remount the folder to an unused drive letter closer to the target.... so c:\stupid\long\folder\path\file1.txt becomes x:\file1.txt
subst works great for this
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst
-
@notverypunny said in Veeeeeeerrrrrryyyyy long paths and filenames:
Quick fix is to remount the folder to an unused drive letter closer to the target.... so c:\stupid\long\folder\path\file1.txt becomes x:\file1.txt
subst works great for this
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst
This, while it works to address the symptom, doesn't fix the plague.
-
@gjacobse said in Veeeeeeerrrrrryyyyy long paths and filenames:
One of the biggest tools you can use is User Education. Long file names will make backups fail. If you are in the legal realm, the users must be educated that they are causing issues that will make your business fail, clients lose the case, and on some level - worse.
Sadly, the data come from entire disk images of all users at the opposing counsel's client; and entire exchange server dumps. I understand the logic behind education, we preach it all the time to our customers. But we never know where the data is coming from until were are headed for trial.
-
@notverypunny said in Veeeeeeerrrrrryyyyy long paths and filenames:
Quick fix is to remount the folder to an unused drive letter closer to the target.... so c:\stupid\long\folder\path\file1.txt becomes x:\file1.txt
subst works great for this
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst
I love subst. We use it regularly for things most people never think of. The issue is subsequent access. I suppose I could create and drop a script into each evidence folder that creates the substitutions whenever they are needed.
I was hoping for a utility that would work much like bitly.com or goo.gl or tiny.cc
In my mind I see it creating symbolic links to the long paths, and then hiding the original paths until the import is finished. Then unlink and unhide.
Simplified explanation, but no so simple to implement.
-
@DustinB3403 said in Veeeeeeerrrrrryyyyy long paths and filenames:
@notverypunny said in Veeeeeeerrrrrryyyyy long paths and filenames:
Quick fix is to remount the folder to an unused drive letter closer to the target.... so c:\stupid\long\folder\path\file1.txt becomes x:\file1.txt
subst works great for this
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst
This, while it works to address the symptom, doesn't fix the plague.
An a plague it is!
-
@siringo said in Veeeeeeerrrrrryyyyy long paths and filenames:
I come cross this from time to time, luckily the document and folder doesn't need to be kept.
I rename the document to '1' and the folder '1', this obviously shortens things greatly.
Maybe you could come up with a clever script that just renames things automatically for you?
Deltree used to work for this.
I've done this manually too, the folder names are "sometimes" important. I'll give this some thought as a script and see what I can come up with.
How did you do it with DelTree?
-
Robocopy
-
@JasGot said in Veeeeeeerrrrrryyyyy long paths and filenames:
@siringo said in Veeeeeeerrrrrryyyyy long paths and filenames:
I come cross this from time to time, luckily the document and folder doesn't need to be kept.
I rename the document to '1' and the folder '1', this obviously shortens things greatly.
Maybe you could come up with a clever script that just renames things automatically for you?
Deltree used to work for this.
I've done this manually too, the folder names are "sometimes" important. I'll give this some thought as a script and see what I can come up with.
How did you do it with DelTree?
My long term memory must have kicked in, deltree hasn't been around for a while.
Maybe try rd or rmdir.
-
@JasGot said in Veeeeeeerrrrrryyyyy long paths and filenames:
@DustinB3403 said in Veeeeeeerrrrrryyyyy long paths and filenames:
@notverypunny said in Veeeeeeerrrrrryyyyy long paths and filenames:
Quick fix is to remount the folder to an unused drive letter closer to the target.... so c:\stupid\long\folder\path\file1.txt becomes x:\file1.txt
subst works great for this
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst
This, while it works to address the symptom, doesn't fix the plague.
An a plague it is!
You can't fix stupid.... you can only try to maintain your sanity
-
@Emad-R said in Veeeeeeerrrrrryyyyy long paths and filenames:
Robocopy
Geeez. I use Robocopy all the time, I can't believe I didn't think of that!
Thanks for the tickler!