批处理命令将文件从源复制到目标 [英] Batch command to copy files from source to destination

查看:83
本文介绍了批处理命令将文件从源复制到目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将文件集从源复制到目标,以下是我正在使用的命令及其正常工作.但是文件夹"29749659"是动态的,并且其名称始终会更改.在解压缩"下,将仅存在一个文件夹.

I need to copy set of files from source to destination, below is the command I am using and its working fine. but folder "29749659" is dynamic and its name always changes. Under "unzipped" only one folder will exist.

xcopy /y C:\Nageswar\unzipped\29749659\files\products\Essbase\EssbaseClient\api\include\* C:\Jenkins\jobs\Planning\branches\develop\workspace\planning\Jni\include

有什么办法可以写命令

推荐答案

for /d %%a in (C:\Nageswar\unzipped\*) do xcopy /y "%%a\files\products\Essbase\EssbaseClient\api\include\*" C:\Jenkins\jobs\Planning\branches\develop\workspace\planning\Jni\include

应该做到这一点-for /d扫描目标目录名以获取目录名,并将找到的每个目录名依次应用于%%a

should accomplish this - the for /d scans the target directoryname for directorynames and applies each found in turn to %%a

这篇关于批处理命令将文件从源复制到目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆