Use the subst command to assign a drive letter to a specific folder
You can substitute a specific folder path with a drive letter using the Powershell and the subst command.
The command follows the format: subst <driveletter> <folder path>
For example, if you wanted to the folder path “\\Fileserver\Share\….\…..\….” with the drive letter Z, you would enter:
subst Z: “\\Fileserver\Share\….\…..\….”
Now the Z: drive is “mapped” directly to the folder. Since you have substituted most of the long file path with Z:, it no longer violates the character limit.
You can now move the files out of this folder to a folder with a shorter file path, you can delete or rename it.
After this, you can delete the virtual drive by running the subst command with the /d parameter. To delete the Z: drive created in the example above, enter:
subst z: /d