7

Say I'm running a python script that doesn't exit properly. The powershell console does not return control to me without having to close the shell and open a new one. With Bash I can simply press Control-C to kill any process. What am I missing here?

Windows 8.1 Powershell

3
  • 2
    Tried Ctrl-Break yet? If that doesn't work your only recourse is to kill the process from the outside (not the shell itself, the Python interpreter). Commented Dec 13, 2016 at 8:19
  • 2
    You are missing Ctrl+Break Commented Dec 13, 2016 at 8:19
  • 1
    Apparently neither of my machines have the "break" key. ctrl-fn-Shift worked on my Z-Book, but my Mac with windows still will not terminate Commented Dec 13, 2016 at 8:38

3 Answers 3

9

To kill a process, you can use the command Stop-Process.

Or you can try Ctrl + Break shortcut.

Sign up to request clarification or add additional context in comments.

Comments

0

Use the following stop-service <service> choose a flag like -force to force stop even if it has dependent services as well.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/stop-service?view=powershell-5.1

Comments

0

On my Dell XPS laptop, which does not have a break key, Ctrl + Fn + B stopped the running program in Powershell.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.