简体   繁体   中英

Cannot kill process with powershell (Stop-Process)

I have a ps1 script (Windows 2008 R2) to kill process:

 Stop-Process -Name "c_proc".

c_proc is a program that runs in console mode. After running this script c_proc does not exit, it just keeps restarting in console mode. Another way to kill c_proc is to kill conhost.exe but it didn't work either. c_proc can exit when you type in its console windows "exit". How can I send the message "exit" to the console window via PowerShell or cmd? How can I kill c_proc ?

This is the right code to kill the process c_proc . I found the parent process:

  Stop-Process -Name "start"
  Stop-Process -Name "c_proc"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM