Save image and shutdown/close

Is there or does anyone plan to create a script that could save image and close blender perhaps even the pc after an overnight render? it might make long renders “greener” ie save electric!

It’s easy: make a bat file with commands to drive Blender to render and to shut down your computer!

interesting so from the os command line is the way to go?
Right so I managed to shut down windows with it but operating blender from there looks trickier. so just run # blender -b file.blend -o //file -F JPEG -x 1 -f 1 then tag on shutdown -s on the end and blender will run save image and windows shuts down after?