How to close an EXE

This is a discussion on How to close an EXE within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Is there a way to close an EXE from another EXE ? Do you use a system command in the ...

How to close an EXE

My OS is Win32 (Win98), I use both Borland 5.5.1 Free Command Line Tools and Dev-C++ 4.01 (MinGW GCC 2.95.2-1).

The reason is that a windows app I created for work is being used against my wishes by coworkers. I have created a new version that will not run unless it detects two hidden text files.

The problem is that they have made copies of the older version, and I want to create a program that will detect it running in the OS and shut it down, then overwrite it to render it useless (hopefully they won't change the file name to something I cannot target).

But the question I posed is interesting, I know of a post on this site that shows some code on how to shut down Windows from an application. If you could do that, surely there must be a way to close one or more Windows application from another. I suspect ( but probably am wrong ) that it could be done with asm code. Microsoft probably saw the ills of someone being capable of doing this, and built the WinOS in such a way to greatly hinder someone trying to do this very thing.