K
K
Konstantin2021-01-30 01:31:34
cmd/bat
Konstantin, 2021-01-30 01:31:34

How to kill all cmd windows except the current one?

I am using .bat with commands:

@echo off
     taskkill / IM cmd.exe
     echo "Тест"


This command closes all open cmd windows, including the current ones. How can I prevent this and not close the current window?

I tried to kill it like this: I

taskkill /F /IM run.bat

run these 2 run.bat files in different directories

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question