Frage

I recently started doing some video recording and I want to record the games that I play at 60 FPS / 1080p with FRAPS. The thing is that my HDD isn't fast enough to record at this setup and that I have a SSD. Since there's not a lot of space on it, I created a Batch file that moves .avi from my SSD to my HDD automatically when I'm playing, without filling up too much my SSD (I split my videos every 4GB). Here's my code:

 @echo off

 :loop
      move C:\FrapsFilmBuffer\*.avi E:\Random\Fraps\Film
      timeout /t 80
 goto loop

My problem is that I can't move the files from "FrapsFilmBuffer" because the script will probably try moving them while there's one that is recording til 4GB. I want to modify my script to make it move the oldest file. That way, it won't try to move all the files and fail because of the one that is saving little by little on my SSD

Thanks a lot!

War es hilfreich?

Lösung

for /f "delims=" %%a in (
    'dir /b /a-d /tw /od "C:\FrapsFilmBuffer\*.avi"'
) do move "C:\FrapsFilmBuffer\%%a" "E:\Random\Fraps\Film" & goto fileMoved
:fileMoved

Getting the list of files in date order, you get the oldest file the first in the list. Move it and leave the loop

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top