TASKLIST batch command

How can using TASKLIST and to run task if not available

egovernmentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
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
Steve KnightIT ConsultancyCommented:
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
ReneGeCommented:
Here are some alternatives to dragon's command line:

ALTERNATIVE 1:
tasklist | find "notepad.exe"  || START "" "%SystemRoot%\system32\notepad.exe"

ALTERNATIVE 2 (not case sensitive because of find /i):
tasklist | find /i "Notepad.exe" || START "" "%SystemRoot%\system32\notepad.exe"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Steve KnightIT ConsultancyCommented:
yes good point ReneGe ... Effectively the same and I would normally include /i to check case insensitively.

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

Cheers,
Rene
Jim-RCommented:
@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)
Steve KnightIT ConsultancyCommented:
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).

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

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

Steve
egovernmentAuthor Commented:
I will review the all answers
MikeIT ProfessionalCommented:
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.
ReneGeCommented:
There was solutions provided, and no followup from poster. Since we put our time helping, I suggest closing it by splitting points.
Steve KnightIT ConsultancyCommented:
Well there were valid answers there, but deleting fine if we have to ... BUT is anything being done about my comment in http:#36900634 ?
ReneGeCommented:
I forgot to mention. If you split points, give mine to Steve, as he's on the 1M finish line..
Steve KnightIT ConsultancyCommented:
Passed it Rene now :-)
Steve KnightIT ConsultancyCommented:
Ah a quality well thought out selection of answer after all, we needn't of worried :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.