Thread: Detect & stopping exe's

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    19

    Detect & stopping exe's

    Could anyone give me any pointers as to which functions I could use to detect an executable starting and then killing it on NT4 / W2K ?

    I have read the docs but am not which one to use.

    Thanks,
    JD

  2. #2
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    Hm. That's an odd operation...

    The best way is to build a DLL and put it in the AppInit_DLLs registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs). Then call ExitProcess in your DllMain. You'll need to have administrative privileges to write to the registry key.
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    19
    Do I have to use a dll? I was hoping to use a windowless exe.

    I am going to use this to block an exe attempting to install software on workstations.


    Thanks,
    John D..

  4. #4
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    What's wrong with a DLL? It's by far the simplest solution. You could use EnumProcesses periodically, then TerminateProcess, but that sounds like hard work.

    I have to ask, having been the victim of poor network administration too often - why are you doing this? NT can lock a user to be able to write to their My Documents and Temp folders and to HKEY_CURRENT_USER only. I see no reason to try to prevent people doing anything by any other means, since in that case they can harm no-one. You have perfectly good security mechanisms in NT.
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    19
    Many of our users visit customer sites. Most of the time they have to login to the customers network.

    The problem is that most of our customers automate delivery of software through an exe run in the login script.
    The name of the exe is always the same.

    I think this is similar requirement as anti-virus software which detects a virus running then blocks it.

    I have nothing against writing a DLL. I reason I asked about the exe is because I have never written a DLL before.

    Thanks,
    John D..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 06-24-2009, 09:49 AM
  2. How to Write a Program in C to detect the Ethernet Cable?
    By christyyim in forum C Programming
    Replies: 1
    Last Post: 03-11-2009, 04:12 AM
  3. Stopping Processes Question
    By brett in forum Linux Programming
    Replies: 3
    Last Post: 06-24-2007, 10:15 PM
  4. Replies: 5
    Last Post: 11-20-2003, 01:27 AM
  5. How to detect special keys using c++
    By sundeeptuteja in forum C++ Programming
    Replies: 1
    Last Post: 07-04-2002, 05:45 PM