In TeamCity, we have a build step that runs a .bat file using the "Command Line" Build step which junctions certain folders. However it always fails with the following error:
'C:\Windows\System32\junction.exe' is not recognized as an internal or external command,
operable program or batch file.
I have played around with using the "Custom Script" option and even if I put in the full path (C:\Windows\System32\junction.exe), I still get the same issue. If I copy over junction.exe to the working directory, it seems to work fine.
The build server is running under a user account, and it has access to the System32 folder. It can run other programs such as C:\Windows\System32\sysinfo.exe fine. Also running the script from the Agent work directory works fine too.
Does anybody know why this is?