Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Running EventGhost as a Windows service ?

If you have a question or need help, this is the place to be.
Post Reply
Snowbird
Experienced User
Posts: 364
Joined: Fri Jul 03, 2009 10:04 am

Running EventGhost as a Windows service ?

Post by Snowbird »

Hello everyone,

first of all, I'd like to thank the creator of EventGhost !!!

Here's my question, currently it is possible to run EG automatically when a windows session is opened, that's fine, but in my situation it's not enough. In fact, my HTPC is not only used for watching movies, I also use it via Remote Desktop (RDP) to run some other tasks (not HTPC related). So when I use the PC via RDP and then disconnect from it, the session is locked (that's a normal windows behaviour), and if after that I want to watch a movie, I can't use my remote control even if EG is already running in the background since the session is locked. So my question are :
1/ is it possible to run EG as a Windows service ?
2/ or is there a way to send login/password information with the remote control to unlock the session to be able to use EG to watch movies ?

I'm using :
- Windows XP SP3
- EG final version
- XBMC final version
- Original XBOX Remote with its receiver

Any help or advice would be greatly appreciated, thank you.

PS. If this subject was already addressed somewhere in this forum, I'm sorry I wasn't able to find the topic.
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Running EventGhost as a Windows service ?

Post by stottle »

So the problem is that after running remote desktop, the htpc is locked? I've run into that too, I have the pc set to autologin at startup so people don't have to enter a password. So RDP does present a problem.

I'm not sure how running EG as a service would help? You still couldn't watch a movie, right? Can you explain the idea a little better?

I'm not going to say this is a good answer, but what I've done the few times I've used Remote Desktop is Restart when I'm done, so the autologin runs and the screen isn't locked.

Brett
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Running EventGhost as a Windows service ?

Post by Bitmonster »

EG won't work right as a service. But you can reconnect the system to the local console, if you use the following command to end the RDP session:

Code: Select all

%windir%\System32\tscon.exe 0 /dest:console
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
kricker
Experienced User
Posts: 147
Joined: Thu Oct 12, 2006 5:49 am
Contact:

Re: Running EventGhost as a Windows service ?

Post by kricker »

Bitmonster wrote:EG won't work right as a service. But you can reconnect the system to the local console, if you use the following command to end the RDP session:

Code: Select all

%windir%\System32\tscon.exe 0 /dest:console
Smooth tip. I'm going to have to try that. It could save me some frustration at times.
n3m3515
Posts: 3
Joined: Sat Jul 04, 2009 2:31 am

Re: Running EventGhost as a Windows service ?

Post by n3m3515 »

Google for Concurrent Sessions remote desktop.
Every version of windows has a hack for setting up what you are talking about.
Ex. my Vista and Win7 PCs are both running Media Center.
By installing the tweaks (hacks) for enabling Concurrent Sessions on RDP
I don't disturb my wife (watching the HTPC) while I log into it remotely and start a download
that will take some time to complete.
She never knows I am there. She stays logged in and running smoothly.

N3M3515
kricker
Experienced User
Posts: 147
Joined: Thu Oct 12, 2006 5:49 am
Contact:

Re: Running EventGhost as a Windows service ?

Post by kricker »

n3m3515 wrote:Google for Concurrent Sessions remote desktop.
Every version of windows has a hack for setting up what you are talking about.
Ex. my Vista and Win7 PCs are both running Media Center.
By installing the tweaks (hacks) for enabling Concurrent Sessions on RDP
I don't disturb my wife (watching the HTPC) while I log into it remotely and start a download
that will take some time to complete.
She never knows I am there. She stays logged in and running smoothly.

N3M3515
I've done that, but for some reason, on occasion when I log out of the concurrent session it still kicked back to the login screen. Then, if I didn't log out of the concurrent session and the wife or someone wanted to reboot, they get the dialog mentioning someone else is logged in. This confuses them and then I have to deal with it. Or the PC doesn't reboot and waits for that dialog to get dealt with. For the most part I just switched to VNC.
Snowbird
Experienced User
Posts: 364
Joined: Fri Jul 03, 2009 10:04 am

Re: Running EventGhost as a Windows service ?

Post by Snowbird »

Hello,

thank you all for your help, this command is doing exactly what I need :)

Code: Select all

%windir%\System32\tscon.exe 0 /dest:console
Nemesis, since I'm in the same situation as you (wife watching HTPC while husband doing something else via RDP ;) ), your suggestion of using concurrent remote desktop sessions is even better, I'm gonna give it a try and let you know if everything works as expected.

Thanks again for the help and tips ;)

PS. It would be nice though in a future release to give us the possibility to use EG when the session is locked or not even opened, to run other automated tasks (not only HTPC related) with a remote control. Maybe someday, who knows... :)
defecta
Posts: 4
Joined: Wed Jan 18, 2012 2:03 am

Re: Running EventGhost as a Windows service ?

Post by defecta »

SWEET! Thanks guys. That code snippet worked for me too! Excellent work. :D

NOTE: for my Windows 7 box I needed to change the session ID from 0 to 1 for it to work properly. Running

Code: Select all

query session
from a command prompt will list the sessions and you should be able to tell from that what session you want to use.
Last edited by defecta on Sat Jan 21, 2012 5:40 am, edited 1 time in total.
defecta
Posts: 4
Joined: Wed Jan 18, 2012 2:03 am

Re: Running EventGhost as a Windows service ?

Post by defecta »

Actually that code snippet doesn't work for me when trying to get Event Ghost to run the command using the Start Program action. The error is 'file not found'. I have tried using EG to execute a batch which runs tscon.exe and all kinds of different variations but I can't get EG to successfully trigger the tscon.exe command. Also when trying to configure the Start Program action, the file browser window used for pointing to the executable doesn't show or can't find the tscon.exe command in my SYSTEM32 folder (even though its there).

Any suggestions?
TRIROG1
Posts: 45
Joined: Fri Aug 08, 2014 10:07 pm

Re: Running EventGhost as a Windows service ?

Post by TRIROG1 »

Hi!

I'm reviving this old thread...because i'm also trying to have EG to execute the tscon.exe which is located in %windir%/system32.

Using execute action i can't locate this file
But after i did it manually like:

Code: Select all

eg.plugins.System.Execute(u'C:\\Windows\\System32\\tscon.exe', u'RDP-Tcp#0 /dest:console', 0, False, 2, u'C:\\Windows\\System32\\', False, False)
i get an error
LOG:

Code: Select all

11:41:40            Traceback (most recent call last):
11:41:40              Python script "240", line 13, in <module>
11:41:40                eg.plugins.System.Execute(u'C:\\Windows\\System32\\tscon.exe', u'RDP-Tcp#0 /dest:console', 0, False, 2, u'C:\\Windows\\System32\\', False, False)
11:41:40              File "C:\Program Files (x86)\EventGhost\plugins\System\Execute.py", line 133, in __call__
11:41:40                raise self.Exception(FormatError())
11:41:40            Exception: The system cannot find the file specified.
Any ideas how to solve this?
TRIROG1
Posts: 45
Joined: Fri Aug 08, 2014 10:07 pm

Re: Running EventGhost as a Windows service ?

Post by TRIROG1 »

I also tried making a shortcut wthich points to tscon.exe and has exactly the same parameters.

If i click it the session disconnects, but if i have EG run it

Code: Select all

import os
os.startfile("C:\Users\HTPC\Desktop\End RDP")
i get that the system cannot find the tscon.exe and asks if i wuld like to delete shortcut ...
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Running EventGhost as a Windows service ?

Post by kkl »

When using the Start Application action, you might try checking the "Disable WOW64 filesystem redirection for this application". That should at least resolve the file not found error (it did for me when tested).
TRIROG1
Posts: 45
Joined: Fri Aug 08, 2014 10:07 pm

Re: Running EventGhost as a Windows service ?

Post by TRIROG1 »

Awesome!
It works ... - i just managed to lockmyself out of RDP but still ... it works !
Post Reply