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
finding all the points of inflection in a sine curve
Licensing: XP Pro OEM (Resellers COA??)
mailto hyperlink with multiple links on multiple lines
USB HDD for VMware ESXi 4 virtual server?
children games (mind activity) website
Cisco Catalyst 4948> Device can't be seen by others unless they are on the same subnet
Java String Limitations
How I can simplify a series of nested case statements in a MS SQL 2005 query
Excel feature in Java
Sending a simple HTTP request