The script you shared echo cd E:apache-tomcat-9.0.41webapps
just print cd E:apache-tomcat-9.0.41webapps
, check the pic below. We could refer to this doc for more details.
We could copy the file via below cmd. Add task Command line
and enter below script
cd {file path}
copy {file name} {target path}
According to the screenshot you shared, you could try below script
cd C:agent\_work
1a\_nitesh482.Devopswarfilewebapparget
copy webapp.war E:apache-tomcat-9.0.41webapps
Result:
Update1
If the file does not exist, we will get the message: The system cannot find the file specified. and error message: [error]Cmd.exe exited with code '1'
Update2
Please ensure that you are using self-hosted agent instead of hosted agent. If you are using hosted agent, we will get the error message, check the pic below.
Self-hosted agent:
Hosted agent:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…