How to automatically delete old video files

If you find yourself frequently recording your computer, you may want to have your old files deleted automatically to avoid going over your hard disk’s capacity limit. In this case, you can delete old movie files automatically by using 'Task Scheduler' and 'ForFiles' commands of Windows.



To delete old videos automatically, please follow the steps below:

  1. Click on Start, type in "Scheduler" and click "Task Scheduler."

    Start Windows task scheduler

  2. [General] tab: Click "Create Task...", type the name of the task such as "Auto delete old files," and choose "Run whether user is logged on or not."

    How to delete old videos automatically, Image 2

  3. [Triggers] tab: Choose "Daily" to delete old files every day.

    How to delete old videos automatically, Image 3

  4. [Actions] tab: Click "New..." and enter "ForFiles" to add arguments as shown below:

    How to delete old videos automatically, Image 4

    • Argument example 1) If the output folder of Bandicam is "C:\Bandicam" and you want to delete files older than 30 days, enter /p "C:\Bandicam" /s /d -30 /c "cmd /c del @file
    • Argument example 2) If the output folder of Bandicam is "C:\Users\XXX\Documents\Bandicam" and you want to delete files older than 15 days, enter /p "C:\Users\XXX\Documents\Bandicam" /s /d -15 /c "cmd /c del @file


    • Once you've completed the steps above, Windows will automatically delete the files in the folder you specified.

Precautions to take when deleting old video files

  1. You cannot restore the files from the Recycle Bin when using the "ForFiles" command.
  2. You cannot delete files in a network drive. To delete files in the network drive, run the Notepad (Notepad.exe), enter the following text, and then create a batch file (*.bat). You may execute the *.bat file at a specific time on a daily/weekly schedule using Windows Task Scheduler as shown below.
    • net use Z: \\Network-folder-path
      ForFiles /p "Z:" /s /d -30 /c "cmd /c del @file"

    Delete old files, batch file

    - You have to enter your network drive instead of Z:
    - You have to enter the exact folder path instead of \\Network-folder-path