I have been tasked with copying all .txt files from the Program Files folder as well as all of it's subdirectories to another folder I have created. The script I have:
xcopy c:\"program files"\*\*.txt c:\temp\myfiles\lessons
doesn't want to work. What am I missing?
If you want to maintain the folder structure,
xcopy /s "c:\program files\*.txt" c:\temp\myfiles\lessons
If not,
for /r "c:\program files" %a in (*.txt) do @copy /y "%a" c:\temp\myfiles\lessons
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With