Problem with max path length of 260 char

Page 1 of 2 12 LastLast

  1. Posts : 47
    Windows 7 Home Premium 64bit
       #1

    Problem with max path length of 260 char


    I occasionally encounter problems when copying files from the server at work onto a backup drive where it says that it can't copy the file due to the name being too long.

    I've done some research and I'm aware that the problem is being caused by Win 7's limit of 260 characters on the total path length.

    I'd like to be able to go through and fix the problem by renaming the folders and files concerned but the msg that pops up does not specify *where* the files are, just that there's a problem. I've found some of them but there are still a few causing issues.

    Does anyone know of a way to search a folder and subfolders for any files that would cause a problem? A utility of some sort perhaps? I'm wondering if it would be possible to write a batch file that would recursively search but I'm not expert enough to do it.
      My Computer


  2. Posts : 644
    Windows 7 home premium x64
       #2

    I have encountered this trying to backup an SQL database, I made a copy of the files onto the main drive thereby removing the top 2 folders which was enough to reduce the names to under 255.
    If you want a really long boring exercise you can always open cmd and type
    dir c:\ /s /b > files.txt
    I,m sure you realize this lists all the files into a text file which on opening you can trawl through for the longer paths.

    I dare say someone will have better help. But at least I tried.:)
      My Computer


  3. Posts : 47
    Windows 7 Home Premium 64bit
    Thread Starter
       #3

    Thanks. I have a small right-click utility for folders that I wrote ages ago that copies the filenames and paths into the clipboard and have tentatively tried more or less what you're suggesting. The problem is that the departmental server contains well over 150,000 files so I'd really like to find something that will automate the process and not require me to "trawl through" the list!
      My Computer


  4. Posts : 5,642
    Windows 10 Pro (x64)
       #4

    use robocopy it supports paths longer then 256.
      My Computer


  5. Posts : 47
    Windows 7 Home Premium 64bit
    Thread Starter
       #5

    Thanks. I'll check it out.

    I still need to solve the original problem though of locating the paths that are too long and fixing them - I'm not the only one who uses the dept's server. Some of the others are not as technical and will not want to use a special utility just to copy files. Plus, although the IT dept has become.... tolerant... of my habit if fiddling with my computer they're not going to be impressed if I start installing software on multiple machines without going through them.
      My Computer


  6. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #6

    Robocopy is a built in windows command.
      My Computer


  7. Posts : 47
    Windows 7 Home Premium 64bit
    Thread Starter
       #7

    So I just discovered via Google! Interesting and very flexible. It certainly solves the problem for ME, although not for those of the dept (9/10ths) who are not familiar with DOS. However, it's enough of a fix that I can wait for some free time (hollow laughter), store the paths in a document as per a previous comment and then write myself a Word macro to find any of them longer than 260 char.

    Or... just realised... I can simply paste them into an Excel sheet, one path per row/cell and then easily calculate the length using the LEN() function!

    Thanks for the tip.
      My Computer


  8. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #8

    A lot of people here use it as a file backup utility.
      My Computer


  9. Posts : 47
    Windows 7 Home Premium 64bit
    Thread Starter
       #9

    I can see why. I particularly like the fact that you get a report and (according to Wikipedia) it can resume interrupted copies.
      My Computer


  10. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #10

    There is a tutorial here if you are interested. ROBOCOPY - Create Backup Script
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:07.
Find Us