+ Post New Thread
Results 1 to 5 of 5
Windows Thread, Long file paths... solutions? in Technical; While migrating our admin shared areas into a single shared drive I had a lightbulb moment and thought best to ...
  1. #1
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,716
    Thank Post
    175
    Thanked 227 Times in 209 Posts
    Rep Power
    68

    Long file paths... solutions?

    While migrating our admin shared areas into a single shared drive I had a lightbulb moment and thought best to check the depth \ length of some of the folder and file names being used by staff... turns out I was in for a shock!

    There's some huge names that are going over the (stupid and arcane) Windows file path limit of 255 characters, found them by using this rather nifty Powershell command...

    HTML Code:
    cmd /c "dir \\?\E:\\ /s/b" | ? {$_.length -gt 254}
    The only solution in the meantime is to take the output of said nifty command and get staff to rename the offending directories and files, although I can still open them in Windows as far as I can see so far...

    I do love the post in this thread on Technet forums about it (search for "Why use one word where two will do" within the page!)

    File name too long cannot copy

  2. #2

    Oaktech's Avatar
    Join Date
    Jul 2011
    Location
    Bournemouth
    Posts
    3,099
    Thank Post
    885
    Thanked 610 Times in 479 Posts
    Rep Power
    281

  3. 2 Thanks to Oaktech:

    gshaw (19th December 2011), mac_shinobi (19th December 2011)

  4. #3
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,716
    Thank Post
    175
    Thanked 227 Times in 209 Posts
    Rep Power
    68
    Thanks for the link, looks to be a nicer version of a similar tool I saw on Google trailing earlier on

    Nice bit of tech background on why we've still got a 16-year old issue with Windows 7... some things never change!!!

    Explorer still limited by MAX_PATH

    Robocopy didn't seem to care about copying the files, everything went over OK but in the long run I've got to stop people being so verbose with folder names

  5. Thanks to gshaw from:

    mac_shinobi (19th December 2011)

  6. #4

    Join Date
    Nov 2011
    Posts
    219
    Thank Post
    262
    Thanked 23 Times in 19 Posts
    Rep Power
    12
    A good way of dealing with a single long path, without needing any extra tools, is to mount a directory somewhere along the path as a virtual drive with subst. This can the shorten the path below the limit.
    For example:
    subst X: C:\myreallylongpath\
    del X:\therestofmyreallylongpath.txt

    I think you can also use a special prefix "\\?\" on paths on the command line to get around the limit. For example:
    del "\\?\C:\myreallylongpath\therestofmyreallylongpath .txt"

    Bonus weirdness: a dot at the end of a file name will make it undeletable through explorer.

  7. Thanks to Jollity from:

    gshaw (4th January 2012)

  8. #5

    Join Date
    Nov 2011
    Posts
    219
    Thank Post
    262
    Thanked 23 Times in 19 Posts
    Rep Power
    12
    Quote Originally Posted by ricktor View Post
    the best part is that the program's for free!
    Though "use" does not include deleting or renaming files. You have to pay $69 for the full version to do that.



SHARE:
+ Post New Thread

Similar Threads

  1. Free, secureCloud storage/file sharing solutions?
    By MrBitey in forum General Chat
    Replies: 4
    Last Post: 20th February 2011, 09:51 PM
  2. Activprimary Activote file path errors
    By marsdenprimary in forum Educational Software
    Replies: 2
    Last Post: 27th April 2010, 01:18 PM
  3. Long File and Folder Names
    By karldenton in forum Windows
    Replies: 16
    Last Post: 22nd July 2009, 01:47 PM
  4. Robocopy & long file names
    By cheryl in forum Windows
    Replies: 2
    Last Post: 18th January 2008, 11:27 PM
  5. edit file path in orca
    By russdev in forum Windows
    Replies: 1
    Last Post: 27th October 2005, 09:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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