How to shutdown the computer automatically after a render

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

Maxwellx

  • Posts: 274
  • Joined: Fri Nov 13, 2020 11:03 pm
  • Real Name: Maxwell Allington

How to shutdown the computer automatically after a render

PostThu Apr 15, 2021 6:04 pm

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:
Attachments
script2.jpg
script2.jpg (15.07 KiB) Viewed 344 times
script.jpg
script.jpg (16.7 KiB) Viewed 344 times
Last edited by Maxwellx on Fri Apr 16, 2021 1:50 pm, edited 2 times in total.
Offline

TYKHAN

  • Posts: 168
  • Joined: Fri Aug 05, 2016 3:44 pm
  • Real Name: Abdul Majeed

How to shutdown the computer automatically after a render

PostThu Apr 15, 2021 9:02 pm

Working fine thanx.
Btw does this close davinci resolve AND shutdown the pc?

Sent from my iPhone using Tapatalk
OS: WIN10 Pro 20H2 Build 19042.928 64-bit ENG
BOARD: ASUS X99-E WS
CPU: Intel Xeon E5-1650 v3 3.5GHz
RAM: 4x 16 Kingston DDR4 2133MHz ECC
GPU: GeForce GTX 1080 Ti Driver v462.31
PSU: Corsair RM750w
DaVinci Resolve Studio 17.2.0 build 11
Offline
User avatar

Marc Wielage

  • Posts: 7361
  • Joined: Fri Oct 18, 2013 2:46 am
  • Location: Hollywood, USA

Re: How to shutdown the computer automatically after a rende

PostThu Apr 15, 2021 11:05 pm

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).
marc wielage, csi • VP/color & workflow • chroma | hollywood
Offline

Maxwellx

  • Posts: 274
  • Joined: Fri Nov 13, 2020 11:03 pm
  • Real Name: Maxwell Allington

Re: How to shutdown the computer automatically after a rende

PostThu Apr 15, 2021 11:50 pm

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.
Last edited by Maxwellx on Fri Apr 16, 2021 1:57 pm, edited 3 times in total.
Offline

Maxwellx

  • Posts: 274
  • Joined: Fri Nov 13, 2020 11:03 pm
  • Real Name: Maxwell Allington

Re: How to shutdown the computer automatically after a rende

PostThu Apr 15, 2021 11:56 pm

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)
Offline

Maxwellx

  • Posts: 274
  • Joined: Fri Nov 13, 2020 11:03 pm
  • Real Name: Maxwell Allington

Re: How to shutdown the computer automatically after a rende

PostFri Apr 16, 2021 1:58 pm

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)
Offline
User avatar

Phil999

  • Posts: 274
  • Joined: Tue Jun 11, 2019 11:12 am
  • Real Name: Philipp Straehl

Re: How to shutdown the computer automatically after a rende

PostFri Apr 16, 2021 8:23 pm

thank you Maxwellx.
Offline

Thom Guida

  • Posts: 85
  • Joined: Mon Nov 20, 2017 3:15 pm
  • Location: Wasteland, a state previously known as New Jersey

Re: How to shutdown the computer automatically after a rende

PostMon Apr 19, 2021 3:28 pm

Phil999 wrote:thank you Maxwellx.


Dittos

"I now dub thee, Maxwellx Smart."

*Google* Maxwell Smart for the reference/joke.
RSD v.17.1.1, BMD KB & Micro Panel
Win10Pro64 2004
Nv GTX 2080 Ti dV462.31 & GF Optimizer
Ryzen 3900x@3.8; 64GB
IntelNicI211 12.15.180.0/Aquantia 10TbNic
C:\Sam960 Pro M.2 NvMe 1TB on ASRock x470 Taichi MB v4.2; QNAP Cache 2TB NVMe Raid6 42TB.

Return to DaVinci Resolve

Who is online

Users browsing this forum: aPotato, Bob Rooney, dev_willis, Google [Bot], Google Feedfetcher, miguelsantana, ricardo marty and 87 guests