Results 1 to 15 of 15
  1. #1
    New Lounger
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I search for files by length of path/filename?

    I am trying to copy large volumes of files to an external hard drive. The process stalls when Windows encounters file names too long for the destination folder. It reports (for example) about 100 problems out of over 40,000 files. However, it doesn't tell me what they are unless I iterate through the error messages one by one.

    Is there any way for me to search for files based on the combined length of their path and file name? I found a utility that will search for long file names, but it doesn't include the path.

    Thanks

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    New Lounger
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, forgot to mention that I'm using Windows 7 Home Premium.

  4. #3
    Gold Lounger
    Join Date
    Oct 2007
    Location
    Johnson City, Tennessee, USA
    Posts
    3,203
    Thanks
    37
    Thanked 212 Times in 199 Posts
    Quote Originally Posted by bloomhaven View Post
    Is there any way for me to search for files based on the combined length of their path and file name? I found a utility that will search for long file names, but it doesn't include the path.
    bloomhaven,
    Hello... You could try this free program UltraFileSearch there is a Pay For version also ...With the free you can customize your search parameters ...Have a look see. Regards Fred
    Attached Images Attached Images
    PlainFred

    None are so hopelessly enslaved as those who falsely believe they are free (J. W. Von Goethe)

  5. #4
    New Lounger
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solved!

    Well, UltraFileSearch solved my problem indirectly. While it can't search on the basis of length of name+path, it did let me export the search results to a file. I opened the file in Excel, created a formula to calculate name length, and then sorted.

    So thanks for the suggestion!

  6. #5
    Star Lounger
    Join Date
    Apr 2011
    Posts
    80
    Thanks
    5
    Thanked 15 Times in 14 Posts
    bloomhaven,
    Right click in the search box, it will show a drop-down menu that allows you to add a search filter. Choose Size:

  7. #6
    4 Star Lounger
    Join Date
    Dec 2009
    Location
    New Hampshire USA
    Posts
    424
    Thanks
    12
    Thanked 36 Times in 33 Posts
    A little program called 'Path Scanner' at http://www.parhelia-tools.com/produc...thScanner.aspx can search a drive for files with paths exceeding a specific length limit and list them. The old version (1.1.0.20) is free.

  8. The Following User Says Thank You to - bill For This Useful Post:

    Hardwired (2014-09-02)

  9. #7
    New Lounger
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    0
    Thanked 3 Times in 1 Post

    Command line solution

    A quick way to do this would be to use the command line.

    If you open up a command prompt, change to the folder from which you need to find the file with the longest path (or if you are looking to find the longest file on the whole drive, c: ).

    Then use
    Code:
    dir /b /s
    which will give you a long list of files. You can save this to a text file using the following:
    Code:
    dir /b /s > filelist.csv
    .

    Then you can open up your favourite spreadsheet package, for example Excel and import this csv file. In the B column, use a formula like =Len(A1), and fill that down to the bottom of the list. Then you can sort by column B which will give you the list of files sorted by path length.

    Hope this helps and is understandable.
    Last edited by ec5772; 2012-11-20 at 05:11.

  10. The Following 3 Users Say Thank You to ec5772 For This Useful Post:

    Hardwired (2014-09-02),manoel1961 (2012-11-20),mhujm@aol.com (2014-04-05)

  11. #8
    New Lounger
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up The best answer ec5772!

    I've seen many suggestions of how to search for long file path/names in my drive in order to avoid backup problems and this is the most straight forward solution! Simple, easy and already available in my PC without the need to download programs that, most of them, did not resolve my problem. Thank you ecs5772!

  12. #9
    New Lounger
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    0
    Thanked 3 Times in 1 Post
    Glad you found this helpful. At the bottom left hand corner of the post there is a Thanks button which you can use as appropriate to thank people who have made useful posts.

    Spreadsheet packages are very powerful and can be used to help with a huge variety of problems.

  13. #10
    New Lounger
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I used to have trouble deleting duplicate files. When I tried Long Path Tool, it worked like a charm without harming other files and the best part is that the program's for free!

  14. #11
    New Lounger
    Join Date
    May 2013
    Location
    Lombard. IL
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could also use "Robocopy.exe" to copy the files. If both drives are NTFS formatted, it will copy all the files including those with path\file names exceeding the ~256 character limit. "Robocopy.exe" (version XP010 or later) will handle path\file names up to nearly 32,000 characters in length.

    If the destination drive is not NTFS formatted, or if you don't want to copy the files with the "very long" path\file names, you can use the Robocopy.exe "/256" switch. This will cause Robocopy.exe to skip the "very long" named files and report them to the screen or log.

    According to page 13 in the (XP010) documentation:

    If the /256 switch is used and Robocopy encounters a path name longer than 256 characters, one of the following errors may be reported, depending on the operation being performed on the very long path name at the time:
    The filename, directory name, or volume label syntax is incorrect.
    The system cannot find the file specified.
    The file name or extension is too long.
    You can download the XP010 documentation (PDF). It is also available as "Robocopy.doc" for XP010 version when you download the current version of Robocopy GUI from Microsoft website. (Note: Robocopy GUI includes version XP026 of Robocopy.exe and version XP010 of Robocopy.doc). (If anyone finds full documentation for a more recent version of Robocopy.exe please post a link here).

  15. #12
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Tennessee,USA
    Posts
    132
    Thanks
    12
    Thanked 11 Times in 10 Posts
    Agent Ransack was very popular prior to Win7. The improved search utility of Win7 contributed to the popularity decrease of Agent Ransack. Agent Ransack does allow searching by character instances. If I search the documents folder on my system with Agent Ransack looking for *, it produces 9,239 items!!! If however I search for:
    ?????????????????????????????????????????????????? ???????????????*, it produces only 85 items!!! Increase the ?'s by 15 and it now produces merely 22 items.
    The searched items can be organized by name or folder by simply clicking the tab for each.
    The searched items can also be copied to any blank folder for additional processing.
    it is an oldie that has some interesting features.
    Michael

  16. #13
    New Lounger
    Join Date
    Jun 2013
    Location
    Lahore, Pakistan
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have download Long Path Tool and it is the best solution of your problem.

  17. #14
    New Lounger
    Join Date
    Nov 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I went to the trouble of registering on this forum for the sole purpose of saying: Great post EC5772! No telling how many times I have looked for something that works so well as that.

  18. #15
    New Lounger
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    0
    Thanked 3 Times in 1 Post
    rwilsond, thanks very much for your comments. It is much appreciated - I am subscribed to this thread so I do see your comments and appreciate that you took the time to do this. FYI - at the bottom left hand corner of each post there is a Thanks button which you can use as appropriate to thank people who have made useful posts.

    If there any any further questions I might be able to help with feel free to start a new thread (or find an existing thread with that question) and PM me with a link and I'll try to respond.

Posting Permissions

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