Page 1 of 1

How to shutdown the computer automatically after a render

PostPosted: Thu Apr 15, 2021 6:04 pm
by Maxwellx
Shrinivas Ramani wrote:Hi

Resolve 17 has the option for a post-render script (Render Settings > Advanced > Trigger Script at end of render job). You can queue up your render jobs, add a script to the last job in the queue and use that script to set your system to sleep/shutdown/spin-down drives, or even send an email notification so someone can push a button.

Please refer to the What's New in Resolve 17 document (starting page 349)

Regards
Shrinivas

So for people on Windows 10
(I'm sure there are other commands, I don't know, but this works for me) :

1) Create a LUA script with this code in it (just use the notepad) :
Code: Select all
manager = resolve:GetProjectManager()
manager:SaveProject()
strProgram = '"C:\\Windows\\System32\\shutdown.exe" /s /t 00'
os.execute(strProgram)

2) Put the file in C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Deliver - and call it "Shutdown.lua" for example

The first two lines will make Resolve save your project, then it will shut down the computer directly.
/t 00 is the time before the shutting down process (in seconds). You can delay it by giving a duration in seconds.

You can find all the other options here : https://docs.microsoft.com/en-us/window ... s/shutdown

I don't know the commands for Linux or MacOS, but I'm sure it can be found very easily.

I'm sure there are tons of other possibilities, like playing an audio notification, etc. anything that can be triggered by a script.

PS.
Don't test it like I did, with all my applications opened and work not saved :lol:

How to shutdown the computer automatically after a render

PostPosted: Thu Apr 15, 2021 9:02 pm
by TYKHAN
Working fine thanx.
Btw does this close davinci resolve AND shutdown the pc?

Sent from my iPhone using Tapatalk

Re: How to shutdown the computer automatically after a rende

PostPosted: Thu Apr 15, 2021 11:05 pm
by Marc Wielage
What I've done for years is ballpark-guess how long the render will take, then set an OS timer that adds another hour to that time (for safety) and shuts down the system. If Resolve is finished, it will allow the OS to safely exit the program and shut down, provided you have nothing else running (like an unsaved document in the background).

Re: How to shutdown the computer automatically after a rende

PostPosted: Thu Apr 15, 2021 11:50 pm
by Maxwellx
TYKHAN wrote:Working fine thanx.
Btw does this close davinci resolve AND shutdown the pc?

Sent from my iPhone using Tapatalk


This particular one is just sending a signal to shut down the whole computer, regardless of what's oppened (the same way you would do from the start menu).

I added two lines at the beginning of the code. It will save your current project (in Resolve) before shutting down the computer.

Re: How to shutdown the computer automatically after a rende

PostPosted: Thu Apr 15, 2021 11:56 pm
by Maxwellx
Marc Wielage wrote:What I've done for years is ballpark-guess how long the render will take, then set an OS timer that adds another hour to that time (for safety) and shuts down the system. If Resolve is finished, it will allow the OS to safely exit the program and shut down, provided you have nothing else running (like an unsaved document in the background).

You can try it, by changing 00 by 3600, so it would wait one hour before shutting down (I didn't test anything else than the immediate shut down)

Re: How to shutdown the computer automatically after a rende

PostPosted: Fri Apr 16, 2021 1:58 pm
by Maxwellx
I added two lines to the code so the project is saved beforehand.
Code: Select all
manager = resolve:GetProjectManager()
manager:SaveProject()
strProgram = '"C:\\Windows\\System32\\shutdown.exe" /s /t 00'
os.execute(strProgram)

Re: How to shutdown the computer automatically after a rende

PostPosted: Fri Apr 16, 2021 8:23 pm
by Phil999
thank you Maxwellx.

Re: How to shutdown the computer automatically after a rende

PostPosted: Mon Apr 19, 2021 3:28 pm
by Thom Guida
Phil999 wrote:thank you Maxwellx.


Dittos

"I now dub thee, Maxwellx Smart."

*Google* Maxwell Smart for the reference/joke.