The question contains " Did you even bother to read the question? Raul, I understand what you're saying. It's unsafe in many cases, but is safe in some -- such as a kiosk system or a VM where you're in total control of what processes are starting and not — zumalifeguard. Even if you know there's only one cmd.
WooYek WooYek 2 2 silver badges 8 8 bronze badges. Minchurl Minchurl 31 1 1 bronze badge. Guppy Guppy 5 5 bronze badges. This works well for me but it leaves an exe file after retrieving the PID, and it makes me feel a bit of 'virusly', if you know what I mean. Still, a nice trick! Collin Fox Collin Fox 3 3 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 1. Related One of the calls that I'm making in my batch file starts a cmd. So killing that cmd. The problem is that the batch file that I'm in is being handled by another instance of cmd.
What I'm attempting to do is get the PID from the original cmd. That way I can just use the command:. Then when I was ready to kill the hanging cmd window:.
I'd like just to share my piece of code, maybe it will be useful for somebody. It is based on the comment from jiggawagga, but it can terminate many processes:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 1 month ago.
Active 6 years, 6 months ago. Specify a specific process name, to see the process ID for that process. For more information, see Get-Process. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.
Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Submit and view feedback for This product This page.
0コメント