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
CD burner suddenly stopped working after not being used for a year
How SQL injection work?
VB.NET 2008 Dynamically Add Forms Controls Based on Directories and Files
[PS4.0 R6] Datacollector not found
Access 2003: Math question....Calculating a percentage
vCenter local host
Select distinct based on 2 fields
ipod transfer mp3
Windows 7 Folder Modified Date
update user name change from AD to sharepoint 2007