vicki
vicki

Reputation: 157

Batch command to move files to two locations

How do I move files from one location (source), to two locations (target1 and target 2) ?

I have written a batch below, but it moves only to the folder, target1, and not the second folder, target2.

@echo off move /-y "c:\source*.wav" "c:\target1\" move /-y "c:\source*.wav" "c:\target2\"

Please help.

Upvotes: 0

Views: 1419

Answers (1)

Rawns
Rawns

Reputation: 875

You'd need to copy to the first location, then move to the second. Once you move to the first location, there is no original source file to move to the second!

copy /y "c:\source*.wav" "c:\target1\" && move /y "c:\source*.wav" "c:\target2\"

Upvotes: 1

Related Questions