The specified path, file name, or both are too long

Purpose

You want to resolve the error "The file path is too long".

Background

A file name that was provided, either on the source or target computer, is too long. This error is most common when copying files within a directory from one place to another where the target path creates file names that are too long.

Resolution

In Windows typically the fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 

If you receive this error when downloading a package from the package library (typically seen with the .Net 3.5 package) you will need to shorten the path of your repository temporarily.

By default the repository is placed in the Public Documents folder of the server it is installed on at C:\Users\Public\Documents\Admin Arsenal\PDQ Deploy\Repository. You can workaround the file length issue using the steps below.

  1. Create a folder in C:\ named "NET"
  2. Temporarily change the PDQ Deploy repository path to the C:\NET.  This can be done in PDQ Deploy by going to Options > Preferences > Repository.
  3. Attempt the download again.
  4. Once the download completes change your PDQ Deploy repository path back to its previous value.
  5. Manually copy the .Net package files to your PDQ Repository.

Even if your repository is not in the default location you will still want to apply the same steps by reducing the file path length to a shorter one temporarily.

If you receive this error when using the File Copy step, but the Target Folder path would ultimately meet the length requirements once the files/folders are copied, it is likely due to the directory structure needing to first be copied to the target runner directory, listed below, before moving to the final destination.

\\TARGETMACHINE\ADMIN$\AdminArsenal\PDQDeployRunner\service-n\exec 

You'll need to either shorten the directory structure that is being copied, or use a Command/PowerShell step to facilitate the copy in order to circumvent this middle-man runner directory required for the File Copy step.

Still have a question or want to share what you have learned? Visit our Community to get help and collaborate with others.