Results 1 to 12 of 12
  1. #1
    New Lounger
    Join Date
    Sep 2015
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Folder and/or file names too long - options and procedures to shorten

    Dear Lounge members,

    I found a 2012 thread titled "Can I search for files by length of path/filename?" started 06-18-12 by "bloomhaven", and a 09-16-12 reply to that thread/question from "ec5772" titled "Command Line Solution".

    I tried to reply to that thread, but the "Lounge guardian" didn't permit a reply due to a length of time restriction - and so I'm starting this new thread, and am hoping I'm proceeding correctly.

    I am trying to backup folders/files to Microsoft's OneDrive for Business, buit many of my folders and/or riles are rejected from the backup due to the name (the folder(s) name? the file(s) name the entire path name?) being too long, i.e., having too many characters.

    From my review of the command prompt solution posted by ec5772, it looks like using the command lines in that solution might help me in my quest. But, Iím a newbie at command prompt usage Ė in fact, I learned how to open a command prompt, but Iím not sure of the procedure to use to do the needful, as I tried to type in the code suggested by ec5772 into the command prompt, but I ended up getting descriptions of folders/files that I donít need to rename, as the folders/files I want to rename are on a virtual drive (created under TrueCrypt), and when I typed in the code suggested by ec5772, the results didnít have any of my files/folders from the virtual drive I am using Ė and Iím not sure what code I need to type in to search only the folders/files on my virtual drive. Also, if there is a way to narrow the search on the virtual drive to any particular folder(s), that would be helpful, too.

    If anyone can give me some help/direction Ė either with using the command promt procedure that ec5772 had suggested, or with some other procedure that will help me in my ultimate quest: to find my folders/files that have too many characters, and then go about the process of shortening the names, it would be appreciated.

    Thank you.
    mburke

  2. #2
    Silver Lounger wavy's Avatar
    Join Date
    Dec 2009
    Location
    ny
    Posts
    2,367
    Thanks
    233
    Thanked 147 Times in 136 Posts
    One suggestion to help things along. If you right click on the number at the top of a post you can copy the post url. If you click the little globe icon in the bar above the message area when you are posting you can then paste the url in. This enables some to find the post you are referencing and makes it a bit easier for someone to assist.

    David

    Just because you don't know where you are going doesn't mean any road will get you there.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    557
    Thanks
    51
    Thanked 68 Times in 66 Posts
    I used to encounter this when I supported archiving of user files to DVD (a practice thankfully long past). My techniques were comparatively primitive.

    I'd archive the folders and let the copy functions generate errors. Then I'd track down each error and manually shorten the offending files or folders. The problem with trying to automate the shortening process is that you usually wind up implementing simple truncation. Sometimes this results in poor results like names that aren't very descriptive. You can also wind up with duplicate file or folder names.

    The one advantage to shortening names manually is that you usually only have to do it once.

  4. #4
    New Lounger
    Join Date
    Sep 2015
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://windowssecrets.com/forums/sho...l=1#post868971

    Wavy - Great option to have - great suggestion to do - which I attempted and hope it worked.

    Thanks.
    mburke

  5. #5
    New Lounger
    Join Date
    Sep 2015
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    BHarder -

    I have done the same manual renaming of files in order to shorten the file name - and you summed the process up well - except you left out the fact that after a while, the process is so mind-numbing one may be tempted to give every file a one or two-character name - and although you would never be able to find any file, who cares, you never have to do the manual renaming of files thing again.

    And so while I am trying to . . . economize the manual renaming process that I fear I have to do (unless there is some automated process that would permit me to easily truncate the names to my satisfaction), I think what I am hoping for is guidance/suggestions on setting up a global view of the file names (ala an Excel file?) so that I can pick and choose which of the names of the folders, subfolders and/or files I would want to shorten or truncate first before shortening any of the other folders, subfolders and/or files (assuming my first manual shortening/truncation did not do the needful).

    Also, I would be interested in a program or application (is there a difference?) that I could use from here on out whenever I name a file (using my typical long-winded naming technique) that would easily let me know how many more characters I may use in the name before I reach the character limit imposed by OneDrive for Business re copying files to it.

    Thank you.
    mburke

  6. #6
    Silver Lounger wavy's Avatar
    Join Date
    Dec 2009
    Location
    ny
    Posts
    2,367
    Thanks
    233
    Thanked 147 Times in 136 Posts
    Ok given that I don't use onedrive and am not fond of Libraries take this with a grain of salt. MAYBE you

    Edit I just reread and saw true crypt and am not at all sure how off this advice is, but ..

    If you put lower level folders in a library and just back up that library it might be doable, depending on how many folders that would entail.

    David

    Just because you don't know where you are going doesn't mean any road will get you there.

  7. #7
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    557
    Thanks
    51
    Thanked 68 Times in 66 Posts
    When copy errors happen due to length issues, I'm often left bemused as to the precise cause. Is it the total path length for a fully qualified file name, or is it objecting to an individual file or folder in the path? The error messages rarely spell that out. There used to be a hard limit on the length of a FQFN with FAT volumes but we use a lot fewer FAT volumes nowadays.

    Anyhow this is what I would do. Generate a file list including the paths. Slurp that into Excel or your favourite spreadsheet. Then create formulas that calculate the length of the object names involved.

    The file lists can be generated via either of the two following commands. The first creates unified FQFNs, the second separates folder information from file information:

    dir /s /b > BackupList.txt
    tree /f /a > BackupList.txt

    For the second technique you'll have to do some data cleanup first.

    Now comes the hard part: Figuring out how long you can make the names without triggering problems in OneDrive. Honestly unless you can find documentation from Microsoft on the limits of their system, or something on the 'net, you're left with trial and error to figure that out.

  8. #8
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    557
    Thanks
    51
    Thanked 68 Times in 66 Posts
    BTW, my example commands assume you are at the root of the folder you want to back up. If not, either switch to that folder or specify the folder location. e.g.

    dir C:\Users\*.* /s /b > BackupList.txt
    tree C:\Users /f /a > BackupList.txt
    The above examples further assume multiple users on the computer and that you have enough authority to backup all those users.

  9. #9
    Silver Lounger wavy's Avatar
    Join Date
    Dec 2009
    Location
    ny
    Posts
    2,367
    Thanks
    233
    Thanked 147 Times in 136 Posts
    This may help w/ the filename limit question.

    https://msdn.microsoft.com/en-us/lib...7217396#limits


    This guy may have a solution.
    http://forum.piriform.com/?showtopic=38909
    David

    Just because you don't know where you are going doesn't mean any road will get you there.

  10. #10
    jwoods
    Guest
    I've always found it easier to shorten the path to the file by moving it up the hierarchy, rather than shortening the file name, especially if it involves a large number of files.

  11. #11
    jwoods
    Guest
    Before using any tool, I would recommend doing a full disk image.

    Then you have a safety net in case something goes wrong.

  12. #12
    Super Moderator satrow's Avatar
    Join Date
    Dec 2009
    Location
    Cardiff, UK
    Posts
    4,486
    Thanks
    283
    Thanked 574 Times in 478 Posts
    Topic locked, attracting too many spammers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •