I run a webcam that takes an image every 5 seconds within daylight hours and creates around 6000 images throughout the day. When the webcam shuts down I have two batch files that help me sort these files out.
The first file is called (sort.bat) which removes every 20th file from a folder called (alldayvideo) and puts them in a folder called (temp)
Sort.bat...
Code: Select all
@echo off
set Counter=0
for %%f in (c:\alldayvideo\*.jpg) do call :p "%%f"
:p
set /a Counter+=1
set /a X=Counter %% 20
if %X%==0 move %1 C:\temp
The second file (delete.bat) deletes the remaining unwanted files from the (alldayvideo) folder.
Delete.bat...
Code: Select all
@echo off
for %%F in (c:\alldayvideo\*.jpg) do del "%%F"
I run both these files seperatley each day (one after the other) and they work just fine, but I wondered if somebody could offer me a code to do the same job but from just one file.
I've tried doing this myself but I get some odd results.
Any help would be appreciated.
Thanks