Question

We are deploying a website to a DFS share. DFS creates shortcut files with the name .DFSFolderLink.lnk in various locations. Admins on the box do not have rights to delete this shortcut file. So if any exist I need to exclude them from deployment, so that they will not be deleted.

I can already exclude the .DFSFolderLink by passing -skip:File=.DFSFolderLink.lnk to msdeploy. However, if the directory that contains the shortcut file does not exist in the package being deployed, then an error is raised because it tries to delete the folder but cannot because the shortcut file still exists.

How can I get it to exclude the shortcut file and the directory that contains it without knowing ahead of time what the directory name is?

Was it helpful?

Solution

If you don't know the name of the directory, you can't skip it. What you can do is tell msdeploy to ignore the "directory not empty" error using the ignoreErrors provider setting:

msdeploy -verb:sync -source:... ^
         -dest:auto,ignoreErrors=80070091,computerName=... ^
         -skip:File=\.DFSFolderLink.lnk
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top