how to start a long running program at system start and stop at login and restart at logoff

0

I am trying to mine some crypto currency with my computer.
Untill now I have done this:

  1. At system start, I have scheduled a task to start the mining software
  2. at login I have scheduled another task to kill the mining process
  3. Here comes the question: I need to restart the mining process as soon as the user logs off.

But I couldnt figure out how to schedule a task at logoff, so I decided to use Group Policy Ediotr's Logoff scripts. But the problem is, I can't seem to log off at all, because system seems to be waiting for the "script" to finish, and since it is a mining process, it doesn't finish, and the user is never logged off!

How do I configure windows to resume mining after the logoff?

Ali Syed

Posted 2014-05-12T12:08:57.507

Reputation: 161

Answers

1

Rather than do this with a logout script, use the Task Scheduler for this too.

One of the trigger options is for an Event. So in the Triggers tab, create a new trigger, and choose "On an event". then use the following settings:

Log:  Security
Source: Microsoft Windows security auditing
Event id: 4634

Check your event logs, in the security logs to make sure this event ID matches your logoff event and that they are being logged.

Paul

Posted 2014-05-12T12:08:57.507

Reputation: 52 173

I believe you can use the trigger "On disconnect from user session, and the checkbox set to local session" to trigger for a logout event. – LPChip – 2014-05-12T12:46:18.243

it doesnt seem to work! the event is never fired! – Ali Syed – 2014-05-13T14:46:59.857