Can I change the working directory in code without input in web UI?

I have developed a custom build runner. It runs a batch file in the checkout directory in the agent.

In the source code, I use BuildServiceAdapter::makeProgramCommandLine() to return createProgramCommandLine( batchpath, arg ) to run the batch in agent.

Since the default build path is the checkout directory, while running the batch file, there is a warning saying that the batch file could not be run in UNC path. Although it changes the directory the C:/ automatically, the present of warning still makes someone feel not good.

So is there any function or interface that can change the working directory? As I don't want to input it in the UI for every project.

Thank you.

1 comment
Comment actions Permalink

You can construct your own command line with help of jetbrains.buildServer.agent.runner.SimpleProgramCommandLine class. One of it constructos accepts custom working directory.


Please sign in to leave a comment.