Link to home
Start Free TrialLog in
Avatar of egovernment
egovernmentFlag for Afghanistan

asked on

TASKLIST batch command

How can using TASKLIST and to run task if not available

Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

huh? tasklist is a just a list of running processes.. it has nothing to do with actually starting a process (running a program).. a more in-depth version with options is a product by Sysinternals called Process Monitor http://www.microsoft.com/sysinternals
Do you mean if a process is not running then start it?

if so:

@echo off
tasklist | find "notepad.exe" || START "" "notepad.exe"

Will look if notepad.exe is running and if not start it

Steve
ASKER CERTIFIED SOLUTION
Avatar of ReneGe
ReneGe
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes good point ReneGe ... Effectively the same and I would normally include /i to check case insensitively.

Steve
@egovernment:
If you find your solution in my post, please split points with Steve.

Cheers,
Rene
@ve3ofa

My reaction exactly.

"HUH?"

The request is a couple words short of a question, not to mention an actual sentence.  

I don't know how anyone could even speculate what egovernment is asking for sure, but I'm going to try.  

My thinking is that it may have something to do with checking if a specific task is running (that may not be on a list) and then running it if its not there.  This is more like something that Task Scheduler would be capable of in the programming settings of a particular task/s properties.  So perhaps TASKLIST was meant to read Task Scheduler, but in the sense of using a script or batch file to test against a list of Tasks.  (But using eleven words or less)
Judging by previous questions... you have 10 open at the moment egovernment, including other ones I have offered comments against, and going back a couple of weeks.  Perhaps you could clarify / give us feedback please on what has been offered (and the other Q's).

https://www.experts-exchange.com/QH_6254058.html

From previous comments from Community support I think we are wasting our time here.

Steve
Avatar of egovernment

ASKER

I will review the all answers
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
There was solutions provided, and no followup from poster. Since we put our time helping, I suggest closing it by splitting points.
Well there were valid answers there, but deleting fine if we have to ... BUT is anything being done about my comment in http:#36900634 ?
I forgot to mention. If you split points, give mine to Steve, as he's on the 1M finish line..
Passed it Rene now :-)
Ah a quality well thought out selection of answer after all, we needn't of worried :-)