INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Start a program at startup and exit of MC  (Read 940 times)

BayensF

  • World Citizen
  • ***
  • Posts: 114
Start a program at startup and exit of MC
« on: January 02, 2022, 03:34:13 am »

Hi all,

I would like to know if it's possible to start a program at MC startup and exit. I would like to run a windows .bat file to activate and shutdown my amplifier. It's was done through W10 "startup" (speakers on) and "task scheduler" (speaker off). With W11 the "task" does not start, because the HTPC is in "sleep" before it can activate the task (only 1 second left to execute). As a result the Amplifier (ICEpower) does not switch off.

Many thanks in advance for your ideas and I hope sultion,

regards,

Fred
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2661
Re: Start a program at startup and exit of MC
« Reply #2 on: January 02, 2022, 09:52:49 am »

If Windows tasks are unreliable plan B could be a smart plug.

I suppose that "On startup" and "On shutdown" could be added to MC's Scheduler plug-in, but this is more the realm of an OS-level service manager.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: Start a program at startup and exit of MC
« Reply #3 on: January 02, 2022, 11:16:43 am »

Some of the ICEpower amps have auto-sense, which will turn on or off depending on input signal. Does that help?
Logged

BayensF

  • World Citizen
  • ***
  • Posts: 114
Re: Start a program at startup and exit of MC
« Reply #4 on: January 03, 2022, 07:53:03 am »

Some of the ICEpower amps have auto-sense, which will turn on or off depending on input signal. Does that help?

Thanks for your reply. Yes I know this. But I have a relay in between the mains power andthe AMP. With a batch file it switch the AMP on when starting up the HTPC. When I switch the HTPC off it should start the off batch file to switch the mains off. I am just looking for a way to start the batch file when I push the on/off button of my HTPC
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2661
Re: Start a program at startup and exit of MC
« Reply #5 on: January 03, 2022, 08:26:08 am »

Thanks for your reply. Yes I know this. But I have a relay in between the mains power andthe AMP. With a batch file it switch the AMP on when starting up the HTPC. When I switch the HTPC off it should start the off batch file to switch the mains off. I am just looking for a way to start the batch file when I push the on/off button of my HTPC

You could hammer this out with Autohotkey, but the best solution is figuring out why the Windows task scheduler is failing since this is what it is designed for.
Logged

BayensF

  • World Citizen
  • ***
  • Posts: 114
Re: Start a program at startup and exit of MC
« Reply #6 on: January 03, 2022, 08:53:18 am »

Similar problem?

https://yabb.jriver.com/interact/index.php/topic,131586.0.html

Hi Jim,

Thanks for your reply. No sorry not similar. I have a ZWAVE network for other things available not linked to my HTPC. The HTPC is activating my ICEpower AMP PCB integrated in my HTPC through a relay board connected to USB. When the PC is switched on it starts the on.bat file to switch the relay. This can be done by placing the batch file in the Windows start up folder. So now I am looking for a solution to start the batch file with the off command to switch the relay to the NO position. I did it through a "Task Schedule" in windows 10. But Windows 11 is much faster when switching off the computer leaving no time to start the batch file.

F.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: Start a program at startup and exit of MC
« Reply #7 on: January 03, 2022, 11:06:57 am »

Indirect, but you could have a shortcut to a bat file that turns off your relay, then shuts down the system, with a time delay (-t xx) on the shutdown command if necessary.
Logged
Pages: [1]   Go Up