0

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

Rajan Sharma
  • 2,211
  • 3
  • 21
  • 33
jon
  • 213
  • 1
  • 5
  • 18
  • 2
    Try this - [https://stackoverflow.com/questions/23209474/xcopy-wildcard-source-folder-name-to-destination](https://stackoverflow.com/questions/23209474/xcopy-wildcard-source-folder-name-to-destination) – Ismail Jul 17 '19 at 06:00
  • Thanks a lot its working. The solution is for /f "delims=" %%a in ('dir /b/ad "C:\Nageswar\unzipped\*" ') do xcopy /y "C:\Nageswar\unzipped\%%a\files\products\Essbase\EssbaseClient\api\lib\*" C:\Jenkins\jobs\Planning\branches\develop\workspace\planning\Jni\lib\linuxamd64 – jon Jul 17 '19 at 06:13

1 Answers1

0
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

Magoo
  • 77,302
  • 8
  • 62
  • 84