Task scheduler running duplicates of my .bat despite setting not to

1

Hey kind of a noob with this stuff.

But I set up a task scheduler to when idle for 5 minutes, run a .bat.

I also have it set to "Do not run multiple instances", yet whenever I come back after an hour, there are 2 or sometimes more instances of the bat running.

Any way to easily stop this?

user4340635

Posted 2017-12-14T09:42:07.040

Reputation: 31

What is your bat doing ? Could you share its content ? – Ob1lan – 2017-12-14T10:38:28.900

It's an ethereum miner Claymore. – user4340635 – 2017-12-14T11:51:27.017

setx GPU_FORCE_64BIT_PTR 0 setx GPU_MAX_HEAP_SIZE 100 setx GPU_USE_SYNC_OBJECTS 1 setx GPU_MAX_ALLOC_PERCENT 100 setx GPU_SINGLE_ALLOC_PERCENT 100 EthDcrMiner64.exe -epool – user4340635 – 2017-12-14T11:52:53.300

Please [edit] your response into your question. – I say Reinstate Monica – 2017-12-14T13:11:22.367

What do you see that indicates two instances of the process are running exactly? I assume you're not seeing instances of cmd.exe which is what the task scheduler executes and you are seeing multiple *something else* that indicates this? Probably an easy solution to prevent this issue and the Task Scheduler is likely working as expected and it's something else you see that indicates the issue you are trying to prevent. The task scheduler will execute the batch script which probably triggers something else, and you assume it's Task Scheduler and it's probably not. Disclose all the detail. – Pimp Juice IT – 2017-12-14T13:41:48.070

Basically the .bat runs a crypto currency miner in a command prompt window. There will be multiple of these open when I come back from the computer, that is what I mean by multiple instances. – user4340635 – 2017-12-14T21:32:00.617

So the name of the process you see multiple of is named EthDcrMiner64.exe, correct? If so then consider using a similar script as I provided in this answer https://superuser.com/questions/1097766/windows-task-scheduler-run-task-if-task-isnt-running/1097805#1097805. The SET EXEName=EthDcrMiner64.exe and then right beneath the :StartSpeedFan put your other logic for the mining, etc. Just be sure the logic that checks whether or not the process is already running is at the top and runs first always. It'll only execute the process if it is not running regardless of the Task Scheduler run.

– Pimp Juice IT – 2017-12-14T23:21:24.780

In addition to the above comment and link I provided, read over my answer here: https://superuser.com/questions/1214736/windows-10-scheduled-tasks-with-workstation-lock-unlock-not-being-triggered/1217125#1217125 for further tips, etc. just in case you find any of that helpful. Implementing a solution as per the first comment should work for you though. Please give me your feedback or tell me if you have any trouble or questions.

– Pimp Juice IT – 2017-12-14T23:22:57.503

Thanks, I am going to try that when I get home. And sorry I know noob question but when it says "schedule this to run" - I assume I paste that code into a text editor and edit it to my situation, but what do I save it as to run in task scheduler? Also, would I run this in the same task scheduler action as the bat? or as a different thing? Will it close the oldest or newest version of the .bat? My worry is that if I have my bat set to run if idle for 5 minutes, won't it costantly open and shut new instances? – user4340635 – 2017-12-15T00:00:13.603

To be clear of my goal. I want when I leave my computer for 5 minutes or more the .bat to run which runes EthDcrMiner64.exe with the paramters set in my .bat - does that script check to see if it is open already? and then refuse to if it already is? That is kind of what I'm looking to have happen here. – user4340635 – 2017-12-15T00:04:57.263

Answers

0

You can limit the max amount of time a task should run, so if you set it to 4 minutes you probably are set.

Ignacio Soler Garcia

Posted 2017-12-14T09:42:07.040

Reputation: 1 729