I have downloaded over 10,000 files and need to move them to a different folder than my downloads folder. Unfortunately, these files have miscellaneous names, and some of them contain invalid characters (particularly a forward slash "/", such as when a file is named "filename 1/2").
These files are individually placed in folders, so I need to remove them by searching with "*", sorting by file type, and selecting the files not in folders. When clicking/dragging to a new folder, the entire window freezes and needs to be restarted. As a workaround, I was attempting to compress the files into a zipped folder to move more easily.
Unfortunately, the compression does not work with file names containing invalid characters. Attempting to search for a forward slash produces no results. Escaping the forward slash with a ~="/" search also produces no results, which is unfortunate since that is the only answer I've found via Google.
A manual search will take far too long. Attempting to compress gives a specific filename (in an error message) which I can then search for, but the compression attempt also takes a significant amount of time, so this process would be lengthy as well.
I'm willing to use any other workarounds for moving large quantities of files as well, but I think it would be productive to clean the file names to prevent similar issues in the future. Does anyone have any advice?
mv
from the commandline? – Lieven Keersmaekers Nov 25 '18 at 15:02[System.IO.Directory]::EnumerateFiles(<yourdownloadfolder>,"*","AllDirectories")
. With that info at hand, it becomes easy(ier) to match each file to a specific pattern and usemove-item
to move it to where you want. – Lieven Keersmaekers Nov 25 '18 at 17:17