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

    Home » Forums » AskWoody support » Windows » Windows 7 » Questions: Windows 7 » Can I search for files by length of path/filename?

    Author
    Topic
    #483854

    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

    Viewing 5 reply threads
    Author
    Replies
    • #1336979

      Oh, forgot to mention that I’m using Windows 7 Home Premium.

      • #1338363

        bloomhaven,
        Right click in the search box, it will show a drop-down menu that allows you to add a search filter. Choose Size:

    • #1336980

      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.:cheers: Regards Fred

      • #1336988

        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!

    • #1339247

      A little program called ‘Path Scanner’ at http://www.parhelia-tools.com/products/pathscanner/PathScanner.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.

      • #1348323

        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.

        • #1357990

          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!

          • #1357995

            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.

        • #1421906

          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.

        • #1482148

          I’m new here, and was searching for the problem you’ve provided the solution for. Thank you! It was so easy to do!

          I never knew this website existed. Now that I do “I’ll be back!”

          –Michael

          p.s.: I haven’t found the “thank you” button yet, but I’ll keep looking.

          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.

    • #1394556

      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 pathfile names exceeding the ~256 character limit. “Robocopy.exe” (version XP010 or later) will handle pathfile 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” pathfile 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:
      [INDENT]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. [/INDENT]

      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).

      • #1394571

        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

        • #2636494

          Thank you SO much for this – am in W7, still use Agent Ransack a lot, never knew it could help me out with finding too-long file name, brilliant!

    • #1422012

      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.

    • #1482150

      The Thanks button is in the bottom left corner of each post. Just click the one you want.

      cheers, Paul

      • #1536996

        Long Path Tool is a best software to solve this issue. 5++ Rating. Long Path Tool is a best software
        it is a free software. You can Try it

    Viewing 5 reply threads
    Reply To: Reply #1422012 in Can I search for files by length of path/filename?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel