2

Tried to offload some files onto an external hard drive, unfortunately because Windows is Windows: the paths are too long.

So I try:

Copy-Item "E:\" -Destination "F:\ableton_backup" -Recurse

And I get the following error:

Copy-Item: Second path fragment must not be a drive or UNC name

Surely there is a simple way to copy a bunch of files across to an external drive?

BitShift
  • 145

1 Answers1

1

It's easy to solve, Windows limits file name paths to a maximum of 260 characters by default, but you can easily fix it by editing the registry, here is how to do it in PowerShell (you will need Administrator priviledges):

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled -Type DWord -Value 1

Restart PowerShell and you should be able to run your command without problems. (If you still can't copy the files after this tweak, restart Windows.)

Ξένη Γήινος
  • 3,902
  • 13
  • 45
  • 84