Any way to automatically restart Blender after a crash during multi-day render?

I frequently run multi-day renders and occasionally get hard boot crashes during the render (and sometimes Windows restarts after an unapproved update…). I’m rendering from the command line via a batch file in Windows 11. Obviously that creates a lot of wasted time because I usually don’t know the render crashed for several hours - for example, during an overnight render.

I have the project files set to skip existing frames so if I can figure out some way to automatically restart the batch file then it won’t be a big deal - computer crashes, reboots and starts up where it left off. I still lose a few minutes but that’s nothing compared to 6 or 8 hours.

The problem is I can’t figure out how to get Blender to restart on reboot. I can move the batch file into the “Startup” directory but it seems that directory is ignored until someone logs in. I tried setting Win11 to not require login but it has no effect - I still have to log in to get it to run the file in the Startup directory.

Has anyone found a way to get Blender to automatically restart in this kind of situation?

This is more of a Windows question I suppose but surely someone has come across this in doing long renders in Blender.

Thanks in advance

A long-standing method is to place the file you want to run in the Startup folder.

When Windows reboots, the file in the Startup folder is executed automatically.

I am not sure if you need to create it as an executable script to automatically render a batch file. :thinking:

I’m on linux for years now, but here was something to start any program as “service”.. (?)

Hmmm :thinking: seems to be this:

If you run Flamenco (from Blender Studio), it runs an instance for each frame, so if Blender were to crash, it will just go on to the next frame. Then you can re-try the crashed one. But I think crashes will be fewer too, as the Blender instance only lasts for one frame. Blender is also invoked w/o extensions so it’s faster to start and also less chance of a crash.

Well, that’s a …unique… approach.

So the issue is not really about Blender but about Windows starting without login… …well actually the issue is that the computer reboots. I can only think of few reasons for this to consistently happen. Overheating would be at the top of the list. Maybe it’s time to clean the fans?.. Change the cooler?.. Well, maybe at least check the temperatures.

Ensure that the pencil supporting the GPU is not loose as well.

Anyway, maybe this might be relevant?.. No idea if it works though.

I could be wrong, but that’s what it looks like. Since it’s not loading extensions/add-ons and is still resident in memory, it runs pretty fast. I’ve compared using Flamenco vs rendering inside Blender and it seems fine, at least on MacOS.

I finally was able to make the Startup folder work. To do that you have to tell Windows to not require login - which I did. However I was doing it through Remote Desktop and it appears Windows ignores that setting if you set it through Remote Desktop. But it doesn’t tell you it ignores the setting.

I connected monitor/keyboard/mouse to the remote computer and changed the setting that way and it now appears to work. That computer opens Blender from the command line and restarts the render when it reboots after a crash.

Not a Blender issue per se but definitely a Blender workflow issue.