0

I invoked the bat from teamcity server. Below is the log. In the bat which has to change directory location to what I have mentioned in the cd.

Starting:C:\AUTOEBCDeployment\Autodeploy.bat
in directory: D:\ProgramData\JetBrains\TeamCity BuildAgent\work\8a77def6c3e16d10
D:\ProgramData\JetBrains\TeamCity BuildAgent\work\8a77def6c3e16d10>cd C:\AUTOEBCDeployment\dist
D:\ProgramData\JetBrains\TeamCity BuildAgent\work\8a77def6c3e16d10>for /F "tokens=*" %a in ('dir /b /a-d *.zip') do set DIST_FILE=%a 
File Not Found
Melebius
  • 6,183
  • 4
  • 39
  • 52
Ayesha
  • 37
  • 1
  • 11
  • 2
    Possible duplicate of [Command Prompt Won't Change Directory](https://stackoverflow.com/questions/11065421/command-prompt-wont-change-directory) – Melebius Jan 12 '18 at 08:11
  • @Melebius Remove the prompt text so we can see the code. Screen shots don't have code attribute and are unnecessary – ACatInLove Jan 12 '18 at 09:17
  • @ACatInLove The paths could be shortened but it is important to keep the information (which [your suggestion](https://stackoverflow.com/review/suggested-edits/18496558) removed) that the command is used to change the drive. Moreover, this question seems to be duplicate, so it does not deserve the care to make it perfect. – Melebius Jan 12 '18 at 10:03

2 Answers2

1

you can set "Working directory" in your build step

enter image description here

Or you can change the agent property. Open buildagent.property file and change the parameter workDir=C:\AUTOEBCDeployment\dist

Senior Pomidor
  • 1,823
  • 1
  • 14
  • 23
0

Had you read the help information from CD /? you'd have spotted the correct syntax is:

CD /D "C:\AUTOEBCDeployment\dist"

The doublequotes are optional but recommended.

Compo
  • 36,585
  • 5
  • 27
  • 39