Batch command to copy files from source to destina

2020-05-02 03:41发布

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

Is there any way to write a command

1条回答
够拽才男人
2楼-- · 2020-05-02 04:04
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

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

查看更多
登录 后发表回答