Windows 7 Need to send a signal SEGV to a running process in windows

sangram

New Member
Joined
Jul 2, 2014
Messages
1
Hi ,

I need to run crash a running a process in Windows . Basically equivalent of kill -11 <pid> in unix .
Do we have some tools to achieve this or is there any we we can write some c++ code to achieve this .

Please do let know .

Regards
Sangram
 

Solution
Hello Sangram, In Windows, you can achieve the equivalent of killing a process in Unix by terminating a process forcibly. There are several ways to do this in Windows:

Using Task Manager:​

  1. Open Task Manager by pressing Ctrl + Shift + Esc.
  2. Locate the Process: Find the process you want to terminate under the "Processes" tab.
  3. Select the Process: Right-click on the process and choose "End Task."

    Using Command Prompt:​

  4. Identify the Process ID (PID): Use the tasklist command in Command Prompt to find the PID of the process.
    Code:
     tasklist
  5. Terminate the Process: Once you have the PID, use the taskkill command to end the process forcefully.
    Code:
     taskkill...
Hello Sangram, In Windows, you can achieve the equivalent of killing a process in Unix by terminating a process forcibly. There are several ways to do this in Windows:

Using Task Manager:​

  1. Open Task Manager by pressing Ctrl + Shift + Esc.
  2. Locate the Process: Find the process you want to terminate under the "Processes" tab.
  3. Select the Process: Right-click on the process and choose "End Task."

    Using Command Prompt:​

  4. Identify the Process ID (PID): Use the tasklist command in Command Prompt to find the PID of the process.
    Code:
     tasklist
  5. Terminate the Process: Once you have the PID, use the taskkill command to end the process forcefully.
    Code:
     taskkill /F /PID

    Using PowerShell:​

    • Find the Process ID (PID): Use the Get-Process cmdlet in PowerShell to get the PID.
      Code:
       Get-Process -Name
    • End the Process: Use the Stop-Process cmdlet to terminate the process.
      Code:
       Stop-Process -ID -Force

      Using C++ Code:​

      If you prefer to write a C++ program to terminate a process, you can use the Windows API functions like OpenProcess and TerminateProcess. Here is a basic outline of how you can achieve this:
      C++:
      #include int main { DWORD pid = ; // Replace with the actual Process ID HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid); TerminateProcess(hProcess, 0); CloseHandle(hProcess); return 0; }
      Remember to replace with the Process ID of the process you want to terminate. These methods should help you achieve the equivalent of killing a process in Windows. Let me know if you need further assistance!
 

Solution
Back
Top