--
Met vriendelijke groeten, Jawade. BackUp-progje weer vernieuwd.
http://jawade.nl/ Met een mirror op http://jawade.fortunecity.com/
Bootmanager (+Vista +Linux), ClrMBR, DiskEdit (+Linux), POP3lezer,
DOS-Filebrowser, Kalender, Webtellers en IP-log, USB-stick tester.
http://www.netikka.net/tsneti/info/tscmd068.htm
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html
I found no tasklist.exe at mij XP-Home pc, but I found it at a XP-
Pro pc. Now it works fine, thanks.
Another question: If there is a batch-process, the name is cmd.exe
but how can I check one specific batch-process?
Jawade wrote:
>
> In article <4839af0b$0$23816$9b53...@news.fv.fi>, Timo Salmi <t...@uwasa.fi> says...
> > Jawade <Henk_...@hotmail.com> wrote:
> > > How to check if a process exist?
> >
> > http://www.netikka.net/tsneti/info/tscmd068.htm
> >
> > All the best, Timo
>
> I found no tasklist.exe at mij XP-Home pc, but I found it at a XP-
> Pro pc. Now it works fine, thanks.
>
> Another question: If there is a batch-process, the name is cmd.exe
> but how can I check one specific batch-process?
Use tasklist /v
The window title for each process will be displayed.
--
Mike Walsh
> Another question: If there is a batch-process, the name is cmd.exe but how
> can I check one specific batch-process?
In general, you can't do that easily: the only reasonable way would be to
look at the window title, but it may not stay set in batch files -
sometimes it becomes the name of the last .EXE to run.
--
T.E.D. (tda...@mst.edu) MST (Missouri University of Science and Technology)
used to be UMR (University of Missouri - Rolla).
Yes but it is possible to set a unique window title for the purpose of
locating the current window then the title can be reset afterwards.
set uniq=%random%
title %uniq%
tasklist /v|find "%uniq%"
title %0
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
> Another question: If there is a batch-process, the name is cmd.exe
> but how can I check one specific batch-process?
Using the second of the tricks in that same item to distinguish between
the potential many cmd.exe processes running. That is usingthe ID-file
as in there or window title-id as suggested by Ted and Todd.
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm
> In general, you can't do that easily: the only reasonable way would be to
> look at the window title, but it may not stay set in batch files -
> sometimes it becomes the name of the last .EXE to run.
Actually, it is not that difficult. E.g. if I happen to run dir /s c:\
in another cmd window the essential information displayed by tasklist /v
concerning that process is
... cmd.exe - dir /s c:\
which is easily tested for.
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland
Wow, that's a miracle. Never too old to learn. All the problems
are solved. Thank you, ant thanks to all.
@echo off & setlocal enableextensions
set myscriptIsRrunning_=
tasklist /v|findstr /b /i /r /c:"cmd.exe.*-.*myscript">nul
if %errorlevel% EQU 0 set myscriptIsRunning=true
if defined myscriptIsRunning (
echo myscript is currently running
) else (
echo myscript is not currently running)
endlocal & goto :EOF
> In article <eJp_j.2029$jI5...@flpi148.ffdc.sbc.com>, Todd Vargo
> <tlv...@sbcglobal.netz> says...
>> "Ted Davis" <tda...@umr.edu> wrote in message
>> news:pan.2008.05.26....@umr.edu...
>> > On Sun, 25 May 2008 21:40:27 +0200, Jawade wrote:
>> >
>> > > Another question: If there is a batch-process, the name is cmd.exe
>> > > but how can I check one specific batch-process?
>> >
>> > In general, you can't do that easily: the only reasonable way would be
>> > to look at the window title, but it may not stay set in batch files -
>> > sometimes it becomes the name of the last .EXE to run.
>>
>> Yes but it is possible to set a unique window title for the purpose of
>> locating the current window then the title can be reset afterwards.
>>
>> set uniq=%random%
>> title %uniq%
>> tasklist /v|find "%uniq%"
>> title %0
>
> Wow, that's a miracle. Never too old to learn. All the problems are
> solved. Thank you, ant thanks to all.
That's strange: all that tells you is that the batch file making
the test is running, but you already know that or it wouldn't be able to
make the test. It doesn't work in that form from other batch files. When
expanded to mark individual batch files, it sometimes fails because the
title has been changed to the name of an application the batch ran.
From the point of view of another batch file the example code reduces in
practice to
change window's title to something random
which is pretty much the state of affairs anyway.
This sort of code is useful for obtaining information about the batch file
that makes the test, but not for reliably obtaining information about
other batch files.
I have a batch file that changes parts or all of the window title many
thousands of times during its run.
Well, it works fine. I use the batch for starting an emailchecker
and with a loop and sleep-timer it stays active. The meaning is
that the process not may start another time. If I try, it checks
if my title exists, and if so, it quittes. I have tested for
changing the title, but it don't. See here the first part from
the batch:
@echo off
tasklist /v|find "ePrompterTimer"
if %errorlevel% EQU 0 goto :end
title ePrompterTimer
:loop
...
Thank you, I have saved it. My batch works fine so I am glad. :-)
>I have a batch file that changes parts or all of the window title many
>thousands of times during its run.
What happens if you set a Window Title with the Title command, Ted?
** Posted from http://www.teranews.com **