OpenELEC Forum
shutdown remote windows machine - Printable Version

+- OpenELEC Forum (
+-- Forum: Generic Forum (
+--- Forum: KODI (
+--- Thread: shutdown remote windows machine (/showthread.php?tid=82740)

shutdown remote windows machine - pelele - 09-19-2016

Hi All,

I have this scenario.
In one room, i have my windows 7 "server", sharing all my video files.
In the living room, I have my Openelec (intel nuc) that plays everything from my server trough the lan.

When I have finshed playing a movie, i would like to shutdown the windows machine (energy saving reasons) from my remote.

I understand that i have to do these steps:
1.- Create a script to shutdown remotely my windows machine.
2.- Bind a key in my remote to execute that script.

For the script I can't use something like this:
because openelec doesn't permit to install de samba common libraries.

And for the bind i could use this:

Someone has a better idea?
Any help would be appreciated!

shutdown remote windows machine - pelele - 10-05-2016

Hi All,

In the end i could do this.

First step, i have intalled openSSH server in my windows machine, and authentication with private/public keys to no ask me password when connecting from openelec to windows.
These two guides are enough for this. Once you can connect with a simple ssh x.x.x.x command without asking password, next step.

You create a script:
/storage/.config/ (chmod +x this file)
import subprocess
import xbmcgui

dialog = xbmcgui.Dialog()

subprocess.Popen('ssh root@ "sh shutdown.bat"', shell=True)
dialog.notification('Remote Shutdown', 'Command sent successfully.', xbmcgui.NOTIFICATION_INFO, 5000)
except Exception:

In the home on your windows machine, you must have the shutdown.bat file with your "shutdown -s -f" command, for example.

And finally, you bind the key: