Set output file name from command line render

I’m shortly going to be running some beginner animation workshops at school - due to time, server space and workstation power they aren’t going to be doing their own rendering. I normally do the renders for my 8 person animation club over a weekend, but this is going potentially to be 30 students and overnight. I thought command line rendering would be the way to go with this as I can write a batch file to chomp through a folder of files, but is there any way I can either set the name of the final video file to the original bender file name, or set it to name then in a defined and sequential way so I can then write another batch file to remane them with their usernames?

See docs.blender manual advanced command_line arguments :

-o, --render-output <path>

Set the render path and file name. Use // at the start of the path to render relative to the blend-file.

…and more…

Thankyou for that, you’ve made my life easier!

In case it’s of use to anybody I included this into a script which generates a batch file to render things sequentially. It’s in perl (because I’m old). It’s based on the fact that all work is saved with a naming convention of studentusernameprojectname.blend - doing a dir >> files.txt command generates a directory listing in a text file from which I remove the unwanted lines at the beginning and end. I can then run this to give me the batch file to run.

use strict;
use warnings;

#Opens the source file “files.txt” and creates the output file “renderblend.bat”

open (FILES, “files.txt”) || die();
open (RENDERSLINES, “>>renderblend.bat”) || die();

while ($filesin = )

#removes newline
#removes information about the file in each line, which happens to be 36 characters long
my $blendFileName = substr $filesin, 36;
#splits the file at the dot to remove the .blend part
my @username = split(‘.’, $blendFileName);
my $projectname = $username[0];
#creates the line to print to the batch file
$lineprint = “blender -b $blendFileName -o "c:\Users\samsp\Desktop\monkey tag renders\$projectname" -a \n”;
#prints line in the batch file
print RENDERLINES $fulldetails

I’m glad this helped… and if you edit your post and select the coding section and choose </> Prefrormatted text then this will be better readable :wink: