Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 676457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:55:47+00:00 2026-05-14T00:55:47+00:00

Note: I’ve asked this question in a similiar format on superuser but it seems

  • 0

Note: I’ve asked this question in a similiar format on superuser but it seems like it may fit here on SO better.
It definitely also is about programming as it concerns parts of the Win32 API, Windows in general and process management.

So there are these processes that can’t be terminated with taskkill – system processes in general. But there also is, for example my Anti Virus program that makes itself “unterminateable”.

  • How can I access and mainly terminate system processes under windows? (kill.exe by Microsoft doesn’t work)

  • How do processes like anti-virus programs protect themselves? How can you turn them off again, then?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:55:47+00:00Added an answer on May 14, 2026 at 12:55 am

    You will need API hooking to guard your process against termination. API hooking is not easy, as it requires either system-wide dll injection and memory editing or a device driver. Read this to get an idea.

    Luckily, there are existing libraries out there, like this one, which I think is shareware now unfortunately. I also found this, and you can probably find more freeware stuff on google.

    To answer your first question, terminating system processes is fairly easy. In C# using the Process.Kill method you can terminate system processes and cause a blue screen if doing it from a windows system service, at least on Windows 7 (I learned this the hard way…). Doing it using the TerminateProcess() function from outside a service will only work if you enable certain permissions: http://www.codase.com/search/call?name=AdjustTokenPrivileges – if I’m not mistaken you need to enable SE_DEBUG_NAME.

    To turn off your antivirus, well, they usually have a menu for that :). To forcefully terminate them, you’ll have to use a termination method that they don’t hook. This page describes a lot.

    Here’s a sample that can terminate the processes you want, supposing the used API functions aren’t hooked. DO NOT RUN THIS UNLESS YOU KNOW WHAT YOU’RE DOING AS IT CAN CAUSE A BLUE SCREEN!

    #include <stdio.h>
    #include <windows.h>
    #include <process.h>
    #include <iostream>
    
    using namespace std;
    
    int EnablePrivilege(const char * lpPrivilegeName, BOOL bEnable)
    {
        TOKEN_PRIVILEGES Privileges;
        ZeroMemory(&Privileges, sizeof(Privileges));
    
        HANDLE hToken;
        BOOL bResult;
    
        if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
            return 1;
        Privileges.PrivilegeCount = 1;
        Privileges.Privileges[0].Attributes = (bEnable) ? SE_PRIVILEGE_ENABLED : 0;
        if (!LookupPrivilegeValue(NULL, lpPrivilegeName,
                                   &Privileges.Privileges[0].Luid))
        {
    
    
            CloseHandle(hToken);
            return 2;
        }
        bResult = AdjustTokenPrivileges(hToken, FALSE, &Privileges, sizeof(Privileges), NULL, NULL);
        CloseHandle(hToken);
        return bResult;
    }
    
    int main()
    {
        cout << EnablePrivilege(SE_DEBUG_NAME, TRUE);
    
        HANDLE procHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, 500); // replace 500 with the PID of the process you want to terminate - can be taken from taskmanager.
    
        TerminateProcess(procHandle, 0);
    
        CloseHandle(procHandle);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: This might seem like a Super User question at first, but please read
Note: since I asked this question, .ix still exists but more or less has
(note this is similar to but not the same as the question I asked
NOTE: This is a followup to my question here. I have a program that
NOTE: This is an old question and the answers here no longer works (since
NOTE: This question is only loosely related to tinyxml, however including details like that
note: I'm working on wordpress but this isn't a wordpress question. I have a
Note 1: This is my first question here. Please be gentle. Note 2: Yes,
Note, this is a follow up to my question here . I'm trying to
Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.