Lokio27
Lokio27

Reputation: 23

Copying many files without extension into one main folder via batch

Right now I have this:

@echo off 
xcopy C:\Users\User\AppData\Roaming\.minecraft\assets\objects\**\* C:\Users\User\AppData\Roaming\.minecraft\assets\objects\extracted 
pause

Basicly what this is supposed to do it copy all the files from the subfolders of objects into a folder called extracted, but it says "File not found - * ; 0 Files Copied ; Press any key to continue"

There are 528 files that need to be all dumped into one folder.

Upvotes: 0

Views: 1878

Answers (1)

Aacini
Aacini

Reputation: 67186

@echo off
cd C:\Users\User\AppData\Roaming\.minecraft\assets\objects
for /D %%a in (*) do (
   if "%%a" neq "extracted" xcopy "%%a\*" extracted /I
)
pause

Upvotes: 1

Related Questions