hello there
I need some advice from u guys.
I'm not a programmer but i can't find a program (free) to do what i want so i tried to do whatever i can to make my work easier.
I need a batch to loop in a directory to find certain files and if the extension is found to call another bat and do the job.
The problem is about the size of the files, if i upload the file in ftp, my bat find extension and fire up the second bat. But the file is not complete uploaded and i have lot's of errors.
After some time researching i thought the only way is to compare size of the file.
I adapted this code to my needs(i'm sure is wrong but now it works):
:1
sleep 5
for /f %%a IN (' dir %source%\*.avi /b dir %source%\*.mpg /b') do set namec=%%~na%%~xa
if "%namec%"=="" goto 1
echo %namec%
set "filemask=D:\ftp\test\*.*"
for %%B in (%filemask%) do set size=%%~zB
for %%c in (%filemask%) do set ext=%%~xc
for %%e in (%filemask%) do set name=%%~ne
sleep 5
set "filemask1=D:\ftp\test\*.*"
for %%D in (%filemask1%) do set sizeo=%%~zD
if %size%==%sizeo% call encode.bat %name% %namec%
rem sleep 5
goto :1
So, is there another way to do that?
Thank u.
Acun
file check
Moderator: DosItHelp