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.

Start Program if not found woes

If you have a question or need help, this is the place to be.
Post Reply
javamarket
Posts: 4
Joined: Fri Feb 08, 2013 11:10 pm

Start Program if not found woes

Post by javamarket »

I must admit I'm at a loss. I've scoured the forums and spent a few days so I'm looking for a little help.
The background is I use EG to launch XBMC. Because of a USB-UIRT problem, I need to kill and restart EG when resume from PC standby.

The startup I have for the XBMC macro is as follows:

Start.Program.XBMC <Event>
Ping: Remote Host: 192.168.1.10 <action> (can ignore this)
Find Window: XMBC <action> (Search invisible, Stop macro if target is found, Program: XBMC.exe)
Start Program: XBMC.exe <action>

So it should look for a running XBMC.exe program / process and if found end the macro. In testing it within EG it works fine.

Now I kill and restart EG from a batch file, and when it runs it always closes and restart XBMC.exe. The batch file makes no reference to XBMC, but if anyone would like to test here is the batch file:

Batch File:

Code: Select all

@echo off
tasklist /nh /fi "imagename eq EventGhost.exe" | find /i "EventGhost.exe" >nul && (
taskkill /F /T /IM EventGhost.exe >nul
 ) || (
rem EventGhost isn't running
)
start "" "C:\Program Files (x86)\EventGhost\EventGhost.exe" -h
themaster1
Experienced User
Posts: 133
Joined: Wed Feb 03, 2010 9:02 pm

Re: Start Program if not found woes

Post by themaster1 »

what's the end goal i don't get it
- restart eventghost with a .bat script for System.Resume
- start xbmc

?
javamarket
Posts: 4
Joined: Fri Feb 08, 2013 11:10 pm

Re: Start Program if not found woes

Post by javamarket »

The end goal is to diagnose why the Macro, although logically outlined fails to operate correctly.
themaster1
Experienced User
Posts: 133
Joined: Wed Feb 03, 2010 9:02 pm

Re: Start Program if not found woes

Post by themaster1 »

When you use find window right after use bring to front action or expect strange things to happen
Also, ensure these values are correct (in configure item for find window xbmc)
program: XBMC.exe
window name: XBMC
window class: XBMC
only return: 1 'th match
Post Reply