Microsoft
Software
Hardware
Network
Question : Batch file to copy folders with a certain name
Hi,
I am a programmer, but the for loops in DOS really confuse me. I've been struggling for the past 2 hours to figure this out. We have certain folders on one drive named "_DAILY". I would like to copy each folder named this to an external hard drive (using the same folder structure).
For instance take the output of this: dir /b /s D:\*_DAILY
and then for each filename do:
robocopy %copyDirectory% %destinationDirectory% /S
Thanks,
Jamie
Answer : Batch file to copy folders with a certain name
Give this a try, see if it gives you some ideas:
@echo off
set DestinationDirectory=X:\
for /F "tokens=*" %%A in ('dir /b /s "c:\*_daily"') do (
robocopy "%%A" %DestinationDirectory%" /S
)
~bp
Random Solutions
iptables explanation
asp.net Can I put more that one mssql table 'field' in one GridView Column?
How do I disable the information bar using group policy
What education path should I take?
How to restart Postgres database?
Open Fire xmpp Chat Server
GPO for Printer Preferences not applying to Windows 7 clients
Cheap Gateway/Firewall Solution
Errors running scheduled task as "Domain Admin" account
Form seems like it is hang during Directory.Getfiles on a large directory structure.