The scenario is that we are copying files out to our drop folders, but we also want to generate a "Latest" symlink that points to the most recent build of that build definition. I've created "Latest" folders in the past with a delete directory/copy command, but I don't want to eat up the hard drive space or add potentially minutes to the build execution time.
Does anyone know of a way to create symlinks during a build in TFS2010/Team Build 2010? The problem lies entirely in the fact that you have to already be elevated/executing as admin to create a symlink and, from what I can tell, the build does not run elevated/as admin. I've tried running the build service under a user account that is a local administrator and it still doesn't work.
I've listed below the following things I've already tried to do to get this to work, but none of them have worked:
If anyone has any ideas or has already done this, I'd be greatly appreciative of any suggestions presented.
Duat Le's suggestion of turning off UAC solved the problem.
Here's what needs to be done to get this to work.
After UAC was turned off, I used an InvokeProcess activity in the workflow, giving it the following values:
Arguments:
"/c mklink /d ""<symlink name>"" ""<directory for symlink to point to>"""
FileName: "cmd.exe"
WorkingDirectory: "<some dir>"