Hi i want to mirror 2 folders
Z:\1 and X:\1
i want any text file that appears on folder Z:\1 to be copied to X:\1
and whatever text gets deleted from Z:\1 to be deleted to X:\1 as well..
i tried with
GetFileList
CopyFile
DeleteFile
but i cant make it work.
any suggestions?
mirror folders
Moderators: Dorian (MJT support), JRL
Re: mirror folders
I made it
Code: Select all
label>start
///PLAYqueued
GetFileList>Z:\PLAYqueued\**,files
Separate>files,;,filenames
if>filenames_count=0
DeleteFile>X:\PLAYqueued\**
goto>End2
endif
let>k=0
Label>Loop
let>k=%k%+1
let>pa=\
Separate>filenames_%k%,pa,text
IfFileExists>X:\PLAYqueued\%text_3%
else
CopyFile>filenames_%k%,X:\PLAYqueued
endif
If>k=%filenames_count%,End,Loop
Label>End
GetFileList>X:\PLAYqueued\**,files
Separate>files,;,filenames
let>k=0
Label>Loop2
let>k=%k%+1
let>pa=\
Separate>filenames_%k%,pa,text
IfFileExists>Z:\PLAYqueued\%text_3%
else
DeleteFile>X:\PLAYqueued\%text_3%
endif
If>k=%filenames_count%,End2,Loop2
Label>End2
wait>1
goto>start
Re: mirror folders
Hi, on my machine, something like this would also work.
Code: Select all
Let>dir1=Z:\PLAYqueued
Let>dir2=X:\PLAYqueued
RunProgram>C:\Windows\System32\robocopy.exe %dir1% %dir2% /MIR
- CyberCitizen
- Automation Wizard
- Posts: 721
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Re: mirror folders
Yes I would suggest looking at RoboCopy as it allows you to copy settings etc.
FIREFIGHTER