Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to move my files from Win 7 to my FreeNAS box. I keep getting errors because my path is too long and some files dont get transferred because it has special characters like the character accents. Some files do get transferred but the file name changes. ie. "é" -> "_".

I am trying to prevent this. What software can i use to scan the given directory for long path names and file names that have invalid characters?

share|improve this question

This powershell script will scan a folder and print all files and folders not containing a set of characters or is above a given length:

$legalChars="^([a-z0-9\.\-_ ])+$";

Get-ChildItem $path -recurse | %{ 

    if(($_.Name).length -gt $length)
        write-host $_.FullName
    elseif($_.Name -notmatch $legalChars)
        write-host $_.FullName        

Edit: It now only tests the length of the filename, not the entire path length, change the first if-condition from .Name to .FullName to test path length instead.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .