Reputation: 125
I have a batch command to copy and move file with a new name to another directory. When I added one more level of subfolder it does not copy but when I remove the added subfolder and move the file to the previous level it does copy. Here is it is:
cd /d dir "U:\Sourcing\Vendor Demand Planning\Customer CPFR\BBM\"
for /f "delims=" %%I in ('dir /b /o:-d "BBM Tool *.xlsx"') do (
copy "%%I" "..\Pricing Project\BBM Tool.xlsx"
exit /b
)
If I removed the BBM level and move the file into the Customer CPFR level it works. I edited this batch from another one that had the target file in the CPFR folder. The file I need to copy is in the BBM folder.
Upvotes: 0
Views: 154
Reputation: 80033
I'd say that the "Pricing Project" directory is on the same level as "Customer CPFR" hence the target of the copy
should be "..\..\Pricing Project...
Also dir
in the CD
line should be removed.
Upvotes: 0