cmd - How to copy only files(not directories) using batch file? -


the directory structure is:

  images     -folder1       -image1.jpg       -image2.jpg     -folder2       -image3.jpg       -image4.png      -folder3       -image6.png       -image7.jpg      -folder4 

i want copy images(i.e *.jpg, *.png) files (not folders) parent directory("images").

i have tried using "robocopy" follows:

robocopy /np ..\..\exam\images ..\..\exam\images *.jpg *.png /s 

here files folders copied :(. need files copied. how this?

many many in advance!

try on command line:

for /r "images" %i in (*.jpg *.png) copy "%~fi" "my\target folder" 

for bach script % must doubled %%.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -