How to automate tasklist?

By jenueheightz ·
Every once in awhile I like to run the tasklist and get an output file.

Can I automate this and place it in my Administrator folder?

Here is what currently do.
tasklist /svc >"h:\my Documents\ed\tasklist_01.doc"

This produces a document which shows all my current processes.

I have tried writing a batch program to run this but I just can not make it work.

Can anyone tell me how I do this?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Batch File

by sbrown95 In reply to How to automate tasklist?

Try something like this:

:::::Begin file::::::::::
@echo off
cd "h:\my documents\ed\"
tasklist /svc >"h:\my documents\ed\tasklist_01.doc"
::::End File:::::

It's really simple, but it should work. Just cut and paste the above into a txt and rename with a .cmd extension.

Collapse -

Sorry but your code did not work. But problem is solved!!!

by jenueheightz In reply to Batch File

Ok I did what you suggested. However it gives the same result as my previous attempts.

Here is what is gives instead of the proper information. As you can see it is not a list from taskliskt.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

H:\My Documents\Ed>

What happens is one command opens then a second one.
The first window has the following in it

'Run' is not recognized as an internal or external command,
operable program or batch file.

Now the second window has

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

H:\My Documents\Ed>

Which is copied to the tasklist_01.doc

Yes it seems like it should be easy but I just do not understand what I am missing. It seems like just never see the command tasklist.

Just figured out what the problem what the problem.

I needed to write it as tasklist.exe not just tasklist.

Tasklist will work in
tasklist /svc >"h:\my documents\ed\tasklist_0r.doc"

However it must have the extension exe to run from a program.

Thank for your reply

Collapse -

I got this one to work

by LocoLobo In reply to How to automate tasklist?

I took sbrown95's text and changed it to

tasklist /svc >"c:\temp\tasklist_01.txt"

saved that as "tasklist.bat", then added it to my scheduled tasks folder. It worked. Cool! For some reason with the @echo off command it wasn't working. It would create an empty file.

Related Discussions

Related Forums