Solution to Mining In Background of Windows or Mac

Hi I have been stuck on this for 4 days straight. How to set up a nice hash miner program in the background? I have been able to use 4 CPUs for mining: 2 Pcs and 2 Mac OS, and they run successfully for nice hash but I was wondering how I could run the miners in the background while I am logged out or if someone else is logged in. i have tried system task manager, amphetamine on MAC OS system, andwriting command lines scripts, etc. If anyone has any way to run a nice hash miner in the background through some way please share. Thanks.

Try task scheduler in windows.

For macOS you can setup a launchdaemon to start or add it to starting programs under settings under your account. If its your machine. If its another machine or shared workplace i would not do that