Killing an Application/Process via a Batch File

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

G'Day,
I want to limit a child's access to a game to certain times.
It's only a simple Application, so I thought two Batch Files may work:
1. To extract the Program Files from a ZIP (she's not yet savvy enough to do
this herself).
2. To delete the Program Files.
By running these two files via Task Scheduler I'd be able to regulate her
access.

However, if she's still playing the game at the time the program files are
to be deleted, I assume that this idea won't work (i.e. can't delete a file
in use).

So can anyone help me kill the actual application/process through a Batch
File?

Or has anyone got a better method altogether?

Cheers.
 
Michael said:
G'Day,
I want to limit a child's access to a game to certain times.
It's only a simple Application, so I thought two Batch Files may work:
1. To extract the Program Files from a ZIP (she's not yet savvy enough to do
this herself).
2. To delete the Program Files.
By running these two files via Task Scheduler I'd be able to regulate her
access.

However, if she's still playing the game at the time the program files are
to be deleted, I assume that this idea won't work (i.e. can't delete a file
in use).

So can anyone help me kill the actual application/process through a Batch
File?
Hi

A)
If you have Windows XP Professional the builtin taskkill.exe
is an option. In a command prompt, run taskkill.exe /? for help.


B)
Some freeware command line tools that can be used for Windows XP Home/Pro:

PsKill.exe in the free PsTools suite at
http://www.sysinternals.com/

Cmdow.exe
http://www.commandline.co.uk/cmdow/index.html
 
Torgeir Bakken (MVP) said:
Hi

A)
If you have Windows XP Professional the builtin taskkill.exe
is an option. In a command prompt, run taskkill.exe /? for help.


B)
Some freeware command line tools that can be used for Windows XP Home/Pro:

PsKill.exe in the free PsTools suite at
http://www.sysinternals.com/

Cmdow.exe
http://www.commandline.co.uk/cmdow/index.html


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Thanks. Big help.
 
Back
Top