copy doc files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mike99
Posts: 1
Joined: 27 May 2021 10:33

copy doc files

#1 Post by mike99 » 27 May 2021 11:38

hello

i want to write code for batch files xcopy all doc files from c: d: drives and subfolders to folder x on usb
and make the names of files short not the same of orginal files

what is the best code in this case

thank you

Lordoa
Posts: 6
Joined: 26 May 2021 09:07

Re: copy doc files

#2 Post by Lordoa » 31 May 2021 13:06

Hello,

I would use the following

Code: Select all

set folderX=Y:\folderx
for /r "C:\" %i in (*.doc) do xcopy "%i" "%folderX%"
for /r "D:\" %i in (*.doc) do xcopy "%i" "%folderX%"
Perhaps there's a better more efficient way to do this, but I'm not familiar enough with all the copy options.

Lordoa

Post Reply