Reputation: 23
This is what I have:
for /R %i in (*.swf) do copy %i C:/testfolder/
I get the error "The system cannot find the file specified.
It's finding the .swf's just fine, but it's not copying them.
Upvotes: 2
Views: 3825
Reputation: 354834
You probably want to put the argument to copy
in quotes as well as use backslashes:
for /R %i in (*.swf) do copy "%i" C:\testfolder\
(though I seriously wonder why you're playing around in the root directory of the drive).
And remember to double the %
if you're using that in a batch file.
Upvotes: 2
Reputation: 1960
You could use xcopy with the excludes argument (if you know what other types of files are present):
xcopy C:\sourcedir C:\destdir /EXCLUDE:excludes.txt /e
Where excludes.txt has a pattern of files not to copy on each line:
.svn
.obj
.js
Upvotes: 0