Y
Y
Yan2021-04-18 14:49:38
cmd/bat
Yan, 2021-04-18 14:49:38

How can one stop the execution of a cmd script by executing another script?

depending on whether the laptop's power adapter is connected or disconnected, batch files with a timer are launched, let's
say 1.cmd 2.cmd
how to make it close when 1.cmd is executed 2.cmd

tasklist sees only cmd.exe conhost.exe

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yan, 2021-04-18
@Slayer_nn

in each cmd add title
taskkill /fi "windowtitle eq qwerty1"
taskkill /fi "windowtitle eq qwerty2"
something like this

V
Vladimir Korotenko, 2021-04-18
@firedragon

I will theorize. The first thing that comes to mind is to use the primitives of the operating system, that is, to create a unique object and check it when the script starts. The second is a variation on the theme if there is this garbage, read the value and kill the script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question