I'd like to stop annoying background process from running shortily after it starts (by another task in task Scheduler). But I do need it to start, at least shortly, as it is important!

Idea was to have task with action taskkill with arguments /im "GPUTweakII.exe", but I get "Last Run Result" 0x1, when test running it.

Ofcourse if I type it in cmd directly it works fine. I am running it with "highest privileges", I have tried both owner user and SYSTEM. Tried running with cmd as task action too, but could not get it to work.

Any ideas?

edit: Okay so I tried it with a script from http://blog.uvm.edu/jgm/2010/04/09/killing-process-as-a-scheduled-task/

I guess one of mistakes I made, I did not use /f (force argument), as I am not sure how closing task will react. If anyone else thinks of something please let me know

  • 1
    How do you start the task itself? If it is also started through TaskScheduler, you can simply make it auto stop after a certain duration. May be much easier than going for this alternate route. – LPChip Dec 24 '17 at 19:30
  • Hey @LPChip , that's a good idea. I have already tried to set "Stop the task if it runs longer than" to "1 minute" , however, minimum shutdown time seems to be 1h hour. I couldn't find any other option to auto stop. I manage to solve it by using script, which I will post as possible answer shortly. But if you find out nicer way, please let me know. – Jonzi Dec 24 '17 at 19:36
  • If you look closely at that dropdown box, you'll notice you can actually type in there. If you type in 1 Minute (capital M), it will actually accept that input and set it to a 1 minute stop. It should also work with the word Second. So you can make a task stop in 10 Seconds if you want. – LPChip Dec 24 '17 at 21:29
  • @LPChip sounds good, doesn't work D: . After rebooting, time is set back to 3 hours. Either it's not working or program refreshes task schedule on start.. Let me try removing ModifyTaskSchedule.exe from installation folde :D – Jonzi Dec 24 '17 at 23:08
  • At last! I got it to work as I wanted. Well almost pefect. First I had to remove ModifyTask.exe and TaskScheduler.dll from installation folder or it would refresh 3day settings. Closing task from trigger setting would crash it, and at last 1 minute timer in settings tab got it to close. For some reason w8.1 does not remove the tray icon until I hover over it, but I can see it's gone from task manager, so that's a succes! – Jonzi Dec 24 '17 at 23:28

When I was trying everything, I noticed setting "Run only when user is logged on" in "General" tab is mandatory and "Run whether user is logged on or not" is wrong. Doesn't make sense, since it gets called after logon anyway, but it works now.

Edit: After some testing I figured, this does not work every time. :( LPChip suggested to change original task to self stop in settings tab. Got this to work, but I had to remove some files from installation folder, as app updated scheduled task each time it started, thus overwritting my settings!! I guess I could disable original task and make new identical one, that program would not auto refresh each time, but removing files worked fine. For some reason it does not remove tray icon right away, only after I hover mouse over, but background process is no longer running, so that's a win!

| improve this answer | |
  • Run only when user is logged on causes your task to run in the security context of your account, which apparently is necessary for your task to interact with the task you are killing. – I say Reinstate Monica Dec 24 '17 at 21:10
  • Glad you got it solved. :) – LPChip Dec 25 '17 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.