1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

file path exceeds 255 chars

Discussion in 'Software' started by ManicD, Apr 12, 2008.

  1. ManicD

    ManicD Byte Poster

    237
    4
    34
    Ok, heres a problem that someone must have a soltion to.

    i work in a school, on our 2003 server we have a folder "02" in that folder is 300 folders each labled with a different username.

    now i need to delete all these folders.

    I CANT do it with windows because most of the folders contain files deep in a folder tree and the Final file path EXCEEDS 255 characters. thsi means windows cant delete them.

    now, i can rename teh first few levels in each usernames folder to shorten the final file path length and thus allow windows to delete the files. but i have 300 such folders to do and dont fancy the idea of spending my week bored ****less.

    anyone got an ingenious way of solving this for me?
     
    Certifications: MCSA, N+, A+(Tech), ECDL
    WIP: 70-294, 70-298
  2. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    can you not just delete the folder from the command prompt? I thought that wouldn't need to iterated through the files to deleted them.

    One way around the 255 character issue, is to map a drive to some point further into the directory path, and this allows you to extend it. ie. if the path is

    \\serv1\share\test\test1\test2\test3\...\test255\

    then map a network drive to \\serv1\share\test\test1\test2\test3\...\test50\

    this shortens the filepath to the file, and makes it useable.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  3. ManicD

    ManicD Byte Poster

    237
    4
    34

    command prompt doesnt work, it still has teh 255 limit.

    i'll have to try the share path thingy, sounds like it could work, depends how windows handles a delete command through a share. does it just issue a local command back and using the standard file path, i dont know
     
    Certifications: MCSA, N+, A+(Tech), ECDL
    WIP: 70-294, 70-298
  4. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    if you are just deleting things, then it might be possible to use a vbscript to rename all files and folders (and subfolders/files) to shorten them as much as possible. That might work.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  5. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present

Share This Page

Loading...