I want to parse a directory and when new files show up it shoud be listed in a queue for a other batch.
I tried it like that:
@echo off
:START
set ftpdir=Z:\FTP\home\
set xdir=Z:\NewDir\
set vtree=v.txt
set vtreecomp=vcomp.txt
if not exist %vtree% (dir %ftpdir% /S/B > %vtree%) else ( goto VCOMPTREE )
exit
:VCOMPTREE
dir %ftpdir% /S/B > %vtreecomp%
fc %vtree% %vtreecomp% > nul
if errorlevel 1 fc %vtree% %vtreecomp% >> queue.txt & exit
goto START
But i don't get only the different lines. What i get:
Vergleichen der Dateien v.txt und VCOMP.txt
***** v.txt
Z:\FTP\home\22.10.2013 #111
Z:\FTP\home\23.10.2013 #222
***** VCOMP.txt
Z:\FTP\home\22.10.2013 #111
Z:\FTP\home\22.10.2013 #111 - Kopie
Z:\FTP\home\23.10.2013 #222
*****
***** v.txt
***** VCOMP.txt
Z:\FTP\home\23.10.2013 #222 - Kopie
*****
What i want:
Z:\FTP\home\22.10.2013 #111 - Kopie
Z:\FTP\home\23.10.2013 #222 - Kopie
Can someone help me with that?