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
mySQL join query how do I write
Event ID 364 when synchronizing WSUS 3.0 SP1
Setup Webmail on MS SBS 2003
Netboot "Client not currently booted"
Trouble with VBScript retrieving Serial Numbers over network
Spell Check is not working on OWA
connect to sql database using php
Desktop on Ubuntu
Can I define a SqlServer Tbl which contains "Objects"
Modify Cron Job