Jump to content

Recommended Posts

Posted

Hi,

 

We have a staff shared area that is 1TB. I am trying to move it from a Qnap NAS to a windows 2012 r2 server. The only problem is teachers have put folders inside of folders and they are silly long.

 

I am wondering what you would all do in this situation?

 

Thanks,

 

Ryan

Posted

That way works but i was just wondering if there was a quicker way or even a way to copy the whole drive. Its not just one there is hundreds of them!! I have been doing this and also renaming them and it is just taking far to long.

 

Thanks

Posted
I'm pretty sure we used Robocopy to do something similar a few years ago. Can't remember exactly how it works but its free and there are plenty of guides if you Google it and i'm sure someone here will be able to tell you what commands to use...
Posted

The following PowerShell script will give you a list of all of the long filenames. Just change the path (in red) to the folder you want to check.

 

Get-ChildItem "[color="#FF0000"]X:\Data[/color]" -File -Recurse | 
Add-Member -MemberType ScriptProperty -Name NameLength -value { $this.name.length } -PassThru -Force |
where {$_.NameLength -ge 80 } | Select FullName

 

Source: www.petri.com/powershell-problem-solver-finding-long-file-names.htm

Posted (edited)

It's down to a flaw in the way Windows stores the path. (256 bytes)

 

Two common approaches are:

1. Map a drive letter as far into the path as you can, then copy (hence shortening the path string)

2. Use Robocopy and prefix the paths with '\\?\' (without the quotes) which will use 32768 characters to store the path.

Edited by jinnantonnixx
  • Thanks 2
Posted

This half-term I am looking to move a lot of shares from our old 2008 server to our new 2012R2, so I may well be interested in this soon...

 

What software are you using to do the copy, or is it a drag and drop operation (as I know that has issues with long folder names)?

 

So far I've heard of robocopy (but not great at command line and amount of switches looks daunting), or File Server Migration Toolkit as I'd prefer something inbuilt. Maybe even take the backup from the night before and restore it to the new server although it's an admin/SLT share and I'd hate to muck up the permissions on it!

 

Kol.

Posted

Hi all,

 

Thank you for this information. What I have decided to do is use tree comp to transfer all the files over and then hopefully at the end it will tell me what errors it had and then I should be able to correct them and then copy them over. The drive is actually 2tb and tree comp is reporting it will take 2 days.

 

Thank you again for your help. I will try the other ways when I get the errors.

Posted
It's down to a flaw in the way Windows stores the path.

Isn't it technically to do with the APIs that each Windows program uses?

 

NTFS, Robocopy and most anti-virus/backup applications support 32,768 character file and folder paths, whereas Explorer is still limited to 260 characters probably because Microsoft is too concerned with breaking old or poorly-written 3rd-party Windows applications. :(

 

NT+ is fully capable of dealing with file names of any size. Win32 on NT can also do this using the \\?\ hack. Almost every filename-related article in MSDN mentions this. However, 99.9% of software out there does this: char filename[MAX_PATH]; and breaks horribly when this is not the case. (Source)
  • 2 weeks later...
Posted
NTFS, Robocopy and most anti-virus/backup applications support 32,768 character file and folder paths, whereas Explorer is still limited to 260 characters probably because Microsoft is too concerned with breaking old or poorly-written 3rd-party Windows applications. :(

See also: Windows 10

 

It's down to a flaw in the way Windows stores the path. (256 bytes)

 

Two common approaches are:

1. Map a drive letter as far into the path as you can, then copy (hence shortening the path string)

2. Use Robocopy and prefix the paths with '\\?\' (without the quotes) which will use 32768 characters to store the path.

Trying to use Robocopy gives me Error 267, directory name is invalid - rather inexperienced though so it might just be me..

Robocopy "\\Path\To\StudentArea\StupidlyLongFileNameBecauseTheStudentDoesn'tKnowHowToUsePunctuationAndWordHasAStupidDefaultFilenamePolicy.docx" "\\Path\To\StudentArea\LessStupidName.docx

Posted
Robcopy doesn't work like that. You specify the folders - and only the folders - for the source and destination. If you want specific files or types of files, these are listed after the folders.

Oh, right, so how does Robocopy get used to rename a file then? O.o Confus'd

Posted
so how does Robocopy get used to rename a file then? O.o Confus'd

I normally use 7-Zip's File Manager to rename files and folders with long names (if Windows is unable to). Robocopy is typically used just to copy the data from one location to another.

Posted
That's not possible with Robcopy.

My apologies, then. With you mentioning it as an approach and that it can handle longer filenames I assumed it could be utilised to modify the name.

I normally use 7-Zip's File Manager to rename files and folders with long names (if Windows is unable to). Robocopy is typically used just to copy the data from one location to another.

Tried using 7Zip. No dice. :(

Posted (edited)

Try DeltaCopy

 

It uses Rsync which is free.

 

DeltaCopy - Rsync for Windows

 

It does sometimes complain about filenames being too long but you can replace the files within in Delta Copy - theres a how to on the net somewhere and it fixes the problem. Its the cygwin files that you replace with the ones on cygwins site and hey presto.

 

http://www.aboutmyip.com/AboutMyXApp/DisplayFAQ.do?fid=12

 

http://benevolentmachine.blogspot.co.uk/2010/10/eliminating-deltacopys-file-name-too.html

Edited by cpjitservices
Posted
My apologies, then. With you mentioning it as an approach and that it can handle longer filenames I assumed it could be utilised to modify the name.

 

Tried using 7Zip. No dice. :(

 

no you just use it to move/copy the files somewhere with a shorter path

Posted (edited)

Just delete the file and pretend Windows had an issue with it due its long filename, it got corrupted and it couldn't be backed-up?

 

See how quickly this student's default file naming policy changes?

 

I am personally going to use this technique with a bit of tech-speak (which they won't understand) to force a change in our ridiculously messy and cluttered shared drive (read: dumping ground).

 

Kol.

 

Edit: What about WinRAR or is this the same procedure that you use with 7zip?

 

Edited by Koldov
  • Thanks 1
Posted
Just delete the file and pretend Windows had an issue with it due its long filename, it got corrupted and it couldn't be backed-up?

 

See how quickly this student's default file naming policy changes?

 

I am personally going to use this technique with a bit of tech-speak (which they won't understand) to force a change in our ridiculously messy and cluttered shared drive (read: dumping ground).

 

Kol.

 

Edit: What about WinRAR or is this the same procedure that you use with 7zip?

 

Ha! Winrar worked!

That's exactly the same process I tried with 7zip but 7zip kept telling me the file couldn't be found (or something to that degree) every time I tried to rename it. Thanks!

 

Didn't want to just delete the file as it's one of our lower-ability kids that has a TA etc. Fairly certain they had no clue it would have caused a problem.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...