how to identify long filepath names

2014-08-06

azim58 - how to identify long filepath names
how to deal with long filenames


Use this command to list all of the filepaths in a folder.

DIR /A /B /S > namelist.txt

Then take this text in Excel and see which names are too long.

This information was found here:
http://discuss.pcmag.com/forums/thread/1004429202.aspx

Use this command to list all of the filepaths in a folder along with short names (the hidden names of files that are less than 6 characters)
dir /a /s /x>names_short.txt

===========================================================================

Once a long filename is found, it can be renamed from the command line using the six character short name.

q

You should be able to do it DOSways, using the eight-character variant from the command line. The eight-character version is the first six characters, plus a tilde, plus a counting number, plus the extension.

An example: if you have two files called:

Thisisareallyreallyreallyreallyreallylongfilename.txt
Thisisanotherreallyreallyreallylongfilename.txt

Then the eight-character versions of the files would be

THISIS~1.TXT
THISIS~2.TXT

respectively.

So, from the command prompt, you can type:

C:\Music\LongFiles\>del THISIS~1.TXT

and the file will be deleted.
posted by DrJohnEvans at 9:55 AM on February 2, 2006


Oops, you want to rename them, not delete them. So:

C:\Whatever\Directory>rename THISIS~1.mp3 MyShortName.mp3


Also
q

The short filenames never have spaces. Use dir /X to find out what the short filenames are, then do what DrJohnEvans said.


Also, this seems quite useful
q

My standard fix is to map a temporary drive letter to the directory I'm working with:

subst T: .
T:
rename "a-very-long-(over-200-characters-here)-name.doc" shortname.doc
E:
subst T: /d



===========================================================================
I also found a link about how to give a folder it's own drive letter
which may be useful.
http://lifehacker.com/267728/give-a-folder-its-very-own-drive-letter


===========================================================================
8-25-12
I used this command to find out my filepath names in preparation to
cancel my LiveDrive account and transfer my files to a physical hard
drive.
Some name list files I was keeping can be found here: