简体   繁体   中英

Copying a file to jenkins workspace location

I need to copy one file to the workspace location of jenkins for my pipeline jenkins job. For that I need to use bat command for windows. What is the bat command to copy the file from one source location to the destination location. I have used the code like

bat '''xcopy /Y /s "<source location>"*.*"<Destination location>"'''

The above code was getting the error as file not found but i have provided the right path of the files. Can anyone please help me with this.

I'm not sure what you are trying to do with the *.* but if you just want to copy a file from the source location to the destination, you should use:

bat '''xcopy /Y /s "<source location>" "<Destination location>"'''

no *.* . You will get file not found with *.* . If this doesn't fulfill your needs, then elaborate on exactly what you are trying to do here and I should be able to help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM