sonypoolplr
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1750
Joined: Fri Mar 26, 2004 8:48 am
Location: New Jersey
Contact: Send private message

Start or Stop Program with myServer

Mon May 01, 2017 2:50 pm

I would like to shutdown another program when I shutdown myServer, and start it back up when myServer is started. I was wondering if anyone knows what the syntax is for this, and also, where do I put the commands in myServer?

Thank you

User avatar
DavidL
Founder
Founder
Posts: 11909
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact: Send private message

Re: Start or Stop Program with myServer

Mon May 01, 2017 5:24 pm


Synergy_Tech
Intermediate
Intermediate
Posts: 310
Joined: Wed Sep 26, 2012 9:36 pm
Contact: Send private message

Re: Start or Stop Program with myServer

Wed May 03, 2017 9:25 pm

I usually put that sort of thing into the system.startup or system.shutdown macros. Syntax would be something like:

Run|Program~<Program.exe>~<optional arguments>
or
Stop|<program name> (example:chrome)

You can also do something like:
Run|taskkill.exe~/F /IM chrome.exe

The syntax may not be exactly correct but I can usually find what I need in command builder

sonypoolplr
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1750
Joined: Fri Mar 26, 2004 8:48 am
Location: New Jersey
Contact: Send private message

Re: Start or Stop Program with myServer

Wed May 03, 2017 9:35 pm

Thank you. So the system.startup and system.shutdown macros get triggered without any extra commands or automation rules needed from me? I was looking around to see if there was something that was triggered at startup and shutdown but I couldn't find it.

sonypoolplr
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1750
Joined: Fri Mar 26, 2004 8:48 am
Location: New Jersey
Contact: Send private message

Re: Start or Stop Program with myServer

Thu May 04, 2017 9:04 am

I am trying the following in the System.Startup macro but I keep getting this error:

5/4/2017 8:57:36 AM Process Primary [1] Error at MoveNext at line #7426 - The system cannot find the file specified

I have tried:

Run|Program~C:\Program Files (x86)\HomeSeer\Speaker\Speaker.exe
Run|Program~"C:\Program Files (x86)\HomeSeer\Speaker\Speaker.exe"
Run|Program~Program Files (x86)\HomeSeer\Speaker\Speaker.exe
Run|Program~Speaker.exe
Run|C:\Program Files (x86)\HomeSeer\Speaker\Speaker.exe
Run|"C:\Program Files (x86)\HomeSeer\Speaker\Speaker.exe"

None of them are working. Anymore help with this would be greatly appreciated.

Thank you

sonypoolplr
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1750
Joined: Fri Mar 26, 2004 8:48 am
Location: New Jersey
Contact: Send private message

Re: Start or Stop Program with myServer

Thu May 04, 2017 9:20 am

As an update, I got this to work:

MLFileOpen|C:\Program Files (x86)\HomeSeer\Speaker\Speaker.exe

But I cannot find the command to shut it down when myServer shuts down.

Thank you


sonypoolplr
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1750
Joined: Fri Mar 26, 2004 8:48 am
Location: New Jersey
Contact: Send private message

Re: Start or Stop Program with myServer

Thu May 04, 2017 1:36 pm

Thank you everyone for the help.

Synergy_Tech
Intermediate
Intermediate
Posts: 310
Joined: Wed Sep 26, 2012 9:36 pm
Contact: Send private message

Re: Start or Stop Program with myServer

Sat May 06, 2017 10:33 pm

I forgot about mlfileopen, that's an old one. I thought the Run command was the replacement. Did you get it all working?

sonypoolplr
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1750
Joined: Fri Mar 26, 2004 8:48 am
Location: New Jersey
Contact: Send private message

Re: Start or Stop Program with myServer

Sun May 07, 2017 10:26 am

Yes I am using: MLFileOpen|C:\Program Files (x86)\HomeSeer\Speaker\Speaker.exe to open it and the taskkill to close it. I haven't had to do a restart yet, I was only testing it through myServer so hopefully it works like it should.

Return to “Advanced Techniques”

Who is online

Users browsing this forum: No registered users and 1 guest