Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm wondering if it's possible to copy only images files from a directory. For example, if source directory has:

a.jpg b.gif c.png d.txt

I want to copy only the images using one command, to get this in the destination directory:

a.jpg b.gif c.png

share|improve this question
2  
i retagged "windows" and "cmd" assuming you're using the CMD terminal on Windows NT/2k/XP/Vista/7. if you're actually using DOS (meaning MS-DOS 6.22 or earlier, or FreeDOS or another DOS variant), please retag with "dos". –  quack quixote Apr 15 '10 at 12:35

1 Answer 1

up vote 3 down vote accepted

At command prompt:

FOR %X IN (*.png *.jpg *.gif) DO COPY %X Destination

In a .bat or .cmd script:

FOR %%X IN (*.png *.jpg *.gif) DO COPY %%X Destination
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.