Accessing mapped drive from agent running as windows service
Hi,
I have to build projects that contain absolute paths with a mapped drive, for example J:\Assemblies\... I read that a lot of people has this need as well and I didn't found a satisfactory solution.
I know that it's better use UNC paths but I don't have the choice because build files (msbuild format) are generated with absolute paths by the IDE.
I created the mapped drive pointing to a local folder by mapping J: to
MyTCmachine\MyProjects.
I changed the user account of the agent from Local system account to my user account with administrator privileges. However it doesn't see the mapped drive.
I also tried to run agent.bat, and in this case the agent sees the mapped drive.
I'm struggling with this problem and I don't know if there is a solution apart to run the service manually.
I think that if I can create the mapped drive before the agent is started automatically as a service, the mapping will be recognized.
Do you know if we can for example start the window service from a batch file that first creates the mapping (subst command), then starts the agent as a service ? This could resolve the problem.
Otherwise, has anyone a solution or a workaround to this problem ?
Thanks.
Please sign in to leave a comment.
Sorry for long the delay. The question is still actual with latest TeamCity release?
Kind regards,
Marina
Yes, it is still an issue with the latest v6 release. I just ran into this problem. So running the agent.bat from the console makes it work - but it's not a very nice solution
I could suggest you to add this action as first build step within build configuration.
Michael
Ok, running the batch file to map the drives as first build steps seems to do the trick.