A tool for managing multiple running dos batches

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
DosAppreciator
Posts: 5
Joined: 05 May 2021 09:01

A tool for managing multiple running dos batches

#1 Post by DosAppreciator » 05 May 2021 09:10

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?

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: A tool for managing multiple running dos batches

#2 Post by aGerman » 05 May 2021 14:54

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

DosAppreciator
Posts: 5
Joined: 05 May 2021 09:01

Re: A tool for managing multiple running dos batches

#3 Post by DosAppreciator » 05 May 2021 17:16

I'll try this on Thursday, thanks Steffen.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: A tool for managing multiple running dos batches

#4 Post by Squashman » 05 May 2021 20:44

TASKLIST with verbose output will also show you what you want. Then you can use TASKKILL.

linda_
Posts: 1
Joined: 20 Jan 2021 00:15
Location: CA
Contact:

Re: A tool for managing multiple running dos batches

#5 Post by linda_ » 05 May 2021 23:27

what does this TASKKILL command do?

DosAppreciator
Posts: 5
Joined: 05 May 2021 09:01

Re: A tool for managing multiple running dos batches

#6 Post by DosAppreciator » 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.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: A tool for managing multiple running dos batches

#7 Post by Squashman » 06 May 2021 07:55

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:\>

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: A tool for managing multiple running dos batches

#8 Post by Squashman » 06 May 2021 07:55

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.

DosAppreciator
Posts: 5
Joined: 05 May 2021 09:01

Re: A tool for managing multiple running dos batches

#9 Post by DosAppreciator » 06 May 2021 09:53

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.

Post Reply