So, the File's actual name consists of the Folder and Sub-Folder name(s) as well.
Technically, Folders are also a File but with a unique attribute designating it as a Folder.Īnd Folder and Sub-Folder names are also included in the full name of the File.
Now allot of people think that the maximum length for the name of a File in Windows is 255 characters. But I ran into a problem, file names that were too long. He asked that I put them onto an external drive for storage. I recently recovered files from several Windows computers for a client. In order for this trick to work you will need to use “C:\Link To Folder” to perform file operations.Did you know that there is a limit to how long a file name can be? Did you know that the character limit also includes the folder name? And what about the Path? Let's take a look at the long folder and file names in Windows. The below command executed on CMD can finish the work: mklink /D "C:\Link To Folder" "C:\Users\Name\Original Folder" Create a symbolic linkĬreating a symbolic link to a part of the path can short the total path length of the file/directory. Force – Make it do that without asking us if we’re sure for every item inside. In order to delete the directory and all the files inside it we will need to use the Remove-Item cmdlet. Destination – Where we want the copy to be Delete Directory Using Remove-Item Move-Item -Path TestSource -Destination TestDestination Instead of Copy-Item, you can use the Move-Item cmdlet in order to move permanently the files from the source to the destination. Note! The copy command will not remove the files inside the source the folder. Recurse – Copy all the items inside to the destination Destination – Where we want the copy to be Copy-Item TestSource -Destination TestDestination –Recurse You need to be inside the path where the “TestSource” directory is located. The cmdlet item for this operation is Copy-Item following by parameters “-Destination” and “-Recurse”. So in the first example, we will try to copy the “TestSource” directory to “TestDestination”. First, open the PowerShell tool by search it on the windows menu. Below we will solve the Destination Path too Long error when copy, move, or delete using the PowerShell tool. PowerShell is known as a powerful tool used by power-users to automate and solve many windows problems. Move, Delete, Or Copy Files Or Directories Using PowerShell Use CMD again to execute the commands.įirst, you will need to move the files with long file name from the directory: ROBOCOPY c:\testetst1\testetst2\testetst3\longpath\testets.zip c:\tmp\ /MOVE /EĪfter that to delete the files from the source directory: Delete c:\testetst1\testetst2\testetst3\longpath\testets.zip /q /f For example, we will fix below the error when you try to delete long file names. You can use this windows utility to copy or move data. Check the destination if it was successful. Note! Edit xcopy *path to source files* the *path to destination* to your real file path.Īfter click Enter, the file will be transferred. Xcopy *path to source files* *path to destination* /O /X /E /H /K
To enable it go to file explorer and access the view tab. Hint! When you try to rename you don’t see the extension, most probability you don’t have it enabled.
If for example you have a zip file just rename. txt files have a higher limit while transferring. Temporarily rename the file extension to textĪccording to Microsoft. This method is applicable when you have a few files/folders to move/delete/copy. This is not always applicable and especially if you have a lot of files that are exceeding the length limit. Execute your operation to see whether the issue goes away and if not continue with the next steps. Rename the parent folder to decrease the full path length. This is a simple way and we will start from this.
READ ALSO - How to Fix DISM Error 1009: The Configuration Registry Database Is Corrupt Temporary Solution: Shorten the name of the parent folder