Share via

Closing a program using Task Scheduler

Anonymous
2011-10-29T19:42:47+00:00

How can I close a .exe program using Task Scheduler? For eg - take the case of NetMeter, I would like the program to be closed automatically everyday at 2 am. Can it b done???

Waiting for a quick reply.............

Regards.

Windows for home | Previous Windows versions | Apps

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. @CmdrKeene 90,621 Reputation points Volunteer Moderator
    2011-11-01T16:29:45+00:00

    Ah I see.  Don't schedule the cmd.exe to run.  Taskkill itself already is an executable command.  So just schedule it directly in the program/script box:

    taskkill /f /im "NetMeter.exe"



    Don't put anything in the arguments box.  When the program runs, you'll briefly see the command prompt open, the program will be ended, then the command prompt will disappear all on its own.

    90+ people found this answer helpful.
    0 comments No comments

16 additional answers

Sort by: Most helpful
  1. @CmdrKeene 90,621 Reputation points Volunteer Moderator
    2011-10-30T02:45:18+00:00

    You can end a running program by name with the TaskKill command at a command prompt.  For example, to force-end all running Notepad windows, you can run this command:

    taskkill /f /im "Notepad.exe"


    The /f means to force it, even if the program tries to ask a question (like "Do you want to save?").  The /im means you want to select a task to kill by image name.  Note that you can use wildcards.  Typing taskkill /im n* would kill every program that had a name beginning with the letter N.

    You can schedule this command with Task Scheduler to run when you desire.

    10+ people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2011-11-02T08:15:52+00:00

    Sir, I am afraid u were wrong a little bit.

    Writing the entire command, i.e., taskkill /f /im "NetMeter.exe" doesn't work out. As u told, i did, bt nothing happened - neither the program closed nor the cmd window window appeared.

    Bt on writing taskkill & /f /im "NetMeter.exe" seperately respectively in the program/script box & Arguements box, it worked out.

    Anyways, u helped me a lot...........

    Thanx again...

    :)

    6 people found this answer helpful.
    0 comments No comments
  3. @CmdrKeene 90,621 Reputation points Volunteer Moderator
    2012-10-29T00:06:35+00:00

    Hey no problem, glad you got it working.  We've all been there!

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2011-11-01T07:44:56+00:00

    Ok I did this.

    In the create new task window under Task Scheduler,

    I wrote the program/script as - 

    C:\Windows\System32\cmd.exe

    & in the arguements box, i wrote -

    taskkill /f /im "NetMeter.exe"Thats all & I created the task, bt the program is not closing.Every night at 2 am, only the command prompt window opens.It is evident I am wrong somewhere, pls rectify me.............Waiting for a quick rply....


    Regards.

    2 people found this answer helpful.
    0 comments No comments