Hi folks,
I have this new issue.
tree directory:
C:\a
C:\b
C:\c
a lot of file arrive on directory c:\a
every 5 minutes start a bat that do this operation:
1 ) move file from a to b (move c:\a\* c:\b)
2) other process..................
3) move file from b to c (move c:\b\* c:\c)
sometimes some process in step 2 terminate in error, and in directory c:\b the file remain forever.
I like to do write this code for check:
dir /b c:\b\* > list_new.txt
move c:\a\* c:\b\
dir /b c:\b > list.txt
new code to write
for every line in list_new.txt check if already exist in list.txt and send a warning
Regards
search old name in list
Moderator: DosItHelp
search old name in list
Last edited by darioit on 30 Nov 2011 05:13, edited 1 time in total.
Re: search old name in list
Thanks aGerman, but I don't need to compare the content of the file, but only the name.
I wrote this code and it seems works fine, any suggestion to improve the code?
Regards
Dario
I wrote this code and it seems works fine, any suggestion to improve the code?
Code: Select all
@echo off
set trovato=
del C:\list_old.txt
ren C:\list.txt list_old.txt
dir /b C:\b > C:\list.txt
for /f %%i in ('dir /b c:\b') do findstr /b %%i C:\list_old.txt > nul && set trovato=%%i && call :errore
goto:eof
:errore
echo routine errore %trovato%
Regards
Dario