Page 1 of 1
A tool for managing multiple running dos batches
Posted: 05 May 2021 09:10
by DosAppreciator
Hi,
We have 23 batches running on one of the servers. All of them are started with TITTLEs, to identify each one visually.
But even with the TITLEs, it's still cumbersome to find a specific batch, in order to close it temporarily while working on a problem related to that batch.
Unfortunately, Task Manager doesn't display the title. Instead, for each running batch, it simply shows a generic "Windows Command Processor" for each batch file.
So, my question, is there a tool to manage batch files? Something that shows the list in a browse screen or grid, and allows us to close it.
The tool can be commercial or free, doesn't matter. It could also be very simple, just something to close running batches without having to search through each window on the desktop.
Do you know of anything like this?
Re: A tool for managing multiple running dos batches
Posted: 05 May 2021 14:54
by aGerman
My proposal:
- open Task Manager
- select the "Details" tab
- right-click the header of an arbitrary column and click item "Select columns"
- scroll the list and check "Command line"
- click OK
In the command lines of the cmd.exe processes you'll find the name of the Batch script each. I guess it'll be sufficently easy to find and terminate the right process now.
Steffen
Re: A tool for managing multiple running dos batches
Posted: 05 May 2021 17:16
by DosAppreciator
I'll try this on Thursday, thanks Steffen.
Re: A tool for managing multiple running dos batches
Posted: 05 May 2021 20:44
by Squashman
TASKLIST with verbose output will also show you what you want. Then you can use TASKKILL.
Re: A tool for managing multiple running dos batches
Posted: 05 May 2021 23:27
by linda_
what does this TASKKILL command do?
Re: A tool for managing multiple running dos batches
Posted: 06 May 2021 07:17
by DosAppreciator
Hi Squash,
Thanks, but I think the users need an interface. But you're right, TASKLIST can be useful in some contexts, when writing batches that need to check if other batches are running.
Squashman wrote: ↑05 May 2021 20:44
TASKLIST with verbose output will also show you what you want. Then you can use TASKKILL.
Re: A tool for managing multiple running dos batches
Posted: 06 May 2021 07:55
by Squashman
linda_ wrote: ↑05 May 2021 23:27
what does this TASKKILL command do?
Code: Select all
H:\>taskkill /?
TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]
Description:
This tool is used to terminate tasks by process id (PID) or image name.
Parameter List:
/S system Specifies the remote system to connect to.
/U [domain\]user Specifies the user context under which the
command should execute.
/P [password] Specifies the password for the given user
context. Prompts for input if omitted.
/FI filter Applies a filter to select a set of tasks.
Allows "*" to be used. ex. imagename eq acme*
/PID processid Specifies the PID of the process to be terminated.
Use TaskList to get the PID.
/IM imagename Specifies the image name of the process
to be terminated. Wildcard '*' can be used
to specify all tasks or image names.
/T Terminates the specified process and any
child processes which were started by it.
/F Specifies to forcefully terminate the process(es).
/? Displays this help message.
Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- -------------------------
STATUS eq, ne RUNNING |
NOT RESPONDING | UNKNOWN
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title
NOTE
----
1) Wildcard '*' for /IM switch is accepted only when a filter is applied.
2) Termination of remote processes will always be done forcefully (/F).
3) "WINDOWTITLE" and "STATUS" filters are not considered when a remote
machine is specified.
Examples:
TASKKILL /IM notepad.exe
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM cmd.exe /T
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
H:\>
Re: A tool for managing multiple running dos batches
Posted: 06 May 2021 07:55
by Squashman
DosAppreciator wrote: ↑06 May 2021 07:17
Hi Squash,
Thanks, but I think the users need an interface. But you're right, TASKLIST can be useful in some contexts, when writing batches that need to check if other batches are running.
Squashman wrote: ↑05 May 2021 20:44
TASKLIST with verbose output will also show you what you want. Then you can use TASKKILL.
Not that hard to build a menu driven interface from the output of the TASKLIST command.
Re: A tool for managing multiple running dos batches
Posted: 06 May 2021 09:53
by DosAppreciator
Yes, but it's not necessary to add another component to the project, Squash. The Details pane in the Task Manager with the Command line showing, is sufficient.
Anyway, thanks for the suggestion.