0

I'm using robocopy to search for a lot of old Illustrator files to convert. They reside in countless folders, and I want to copy all of them to a new working folder so I can batch process them.

My current command looks like this:

robocopy "C:\Files" "C:\IllustratorConversion" *.ai /E /dcopy:T /MT

However, that also creates all of the subfolders as well; there's maybe 600 files to convert, but over 7000 folders and subfolders!

Are there any robocopy flags I can use that will avoid this? e.g., something that will still search for files within subfolders, but copy them all to a single output folder.

1 Answer 1

0

To do this you'll want to use another method to select the files, and then pass those to Robocopy or another utility to move.

PowerShell to do this would probably look something like this:

Get-ChildItem -Path C:\Files\*.ai -Recurse | Move-Item -Destination C:\IllustratorConversions -Force

You can use WhereObject to further filter/specify what you want to select to pass along to the Move command. I haven't messed with robocopy within the PS pipeline, but if you MUST use robocopy, I'd create a simple loop that goes through each item Get-ChildItem finds, and then pass that along to robocopy, setting appropriate flags.

Reference:

2
  • Thanks! Would the Copy-Item cmdlet still work in this case? I want to keep the original files where they are, and just batch process the copies.
    – plamobot
    Commented Aug 28, 2023 at 23:10
  • Yea, in the pipeline you can switch out and replace items as you wish so long as they all deal with the same sorts of data and support the pipeline. Just adjust your arguments as appropriate. Commented Aug 28, 2023 at 23:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .