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
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 - Fixed: Remote Desktop Error Code 0x204 Temporary Solution: Shorten the name of the parent folder