PC Review


Reply
Thread Tools Rate Thread

Checking for see if IE is open ...

 
 
=?Utf-8?B?MTBfYV9j?=
Guest
Posts: n/a
 
      4th Jan 2005
Hello Group:


I want to be able to write a batch file to check to see if IE is open. Is
there a DOS command which can do this?

Thanks in advance.


Michael
 
Reply With Quote
 
 
 
 
Jerold Schulman
Guest
Posts: n/a
 
      4th Jan 2005
On Mon, 3 Jan 2005 20:11:02 -0800, 10_a_c <(E-Mail Removed)> wrote:

>Hello Group:
>
>
>I want to be able to write a batch file to check to see if IE is open. Is
>there a DOS command which can do this?
>
>Thanks in advance.
>
>
>Michael


See tip 6313 in the 'Tips & Tricks' at http://www.jsiinc.com or pulist.exe (tip 3737)

set IE=N
for /f "Tokens=1" %%a in ('tasklist^|Find /I "iexplore.exe"') do (
set IE=Y
)
If "%IE%" EQU "Y" go IEisRunning


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Reply With Quote
 
=?Utf-8?B?MTBfYV9j?=
Guest
Posts: n/a
 
      5th Jan 2005
Jerold:


Thanks for the link. I have W2K Server SP4 on my laptop and have recently
downloaded the support tools which includes "tlist". The link gives some
expamples but includes "Tokens" which the batch complains about.


thanks again,


Michael
"Jerold Schulman" wrote:

> On Mon, 3 Jan 2005 20:11:02 -0800, 10_a_c <(E-Mail Removed)> wrote:
>
> >Hello Group:
> >
> >
> >I want to be able to write a batch file to check to see if IE is open. Is
> >there a DOS command which can do this?
> >
> >Thanks in advance.
> >
> >
> >Michael

>
> See tip 6313 in the 'Tips & Tricks' at http://www.jsiinc.com or pulist.exe (tip 3737)
>
> set IE=N
> for /f "Tokens=1" %%a in ('tasklist^|Find /I "iexplore.exe"') do (
> set IE=Y
> )
> If "%IE%" EQU "Y" go IEisRunning
>
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com
>

 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      5th Jan 2005
In microsoft.public.win2000.cmdprompt.admin =?Utf-8?B?MTBfYV9j?=
wrote:

> Michael
> "Jerold Schulman" wrote:
>
>> On Mon, 3 Jan 2005 20:11:02 -0800, 10_a_c
>> <(E-Mail Removed)> wrote:
>>
>> >Hello Group:
>> >
>> >
>> >I want to be able to write a batch file to check to see if IE is
>> >open. Is there a DOS command which can do this?
>> >
>> >Thanks in advance.
>> >
>> >
>> >Michael

>>
>> See tip 6313 in the 'Tips & Tricks' at http://www.jsiinc.com or
>> pulist.exe (tip 3737)
>>
>> set IE=N
>> for /f "Tokens=1" %%a in ('tasklist^|Find /I "iexplore.exe"') do
>> (
>> set IE=Y
>> )
>> If "%IE%" EQU "Y" go IEisRunning


> Jerold:
>
>
> Thanks for the link. I have W2K Server SP4 on my laptop and have
> recently downloaded the support tools which includes "tlist". The
> link gives some expamples but includes "Tokens" which the batch
> complains about.


You can change to use "token 2" or just use pslist.ese (Sysinternals)
and change it from
('tasklist^|Find /I "iexplore.exe"')
to
('pslist^|Find /I "iexplore"')
 
Reply With Quote
 
=?Utf-8?B?MTBfYV9j?=
Guest
Posts: n/a
 
      5th Jan 2005
Mark:


Thanks for the update. I fumbled around and got it to work with -

tlist|find /i "iexplore.exe"
if not errorlevel 1 (
set IE=Y
goto IEisRunning
:IEisRunning
echo inside IEisRunning
:end


Michael


"Mark V" wrote:

> In microsoft.public.win2000.cmdprompt.admin =?Utf-8?B?MTBfYV9j?=
> wrote:
>
> > Michael
> > "Jerold Schulman" wrote:
> >
> >> On Mon, 3 Jan 2005 20:11:02 -0800, 10_a_c
> >> <(E-Mail Removed)> wrote:
> >>
> >> >Hello Group:
> >> >
> >> >
> >> >I want to be able to write a batch file to check to see if IE is
> >> >open. Is there a DOS command which can do this?
> >> >
> >> >Thanks in advance.
> >> >
> >> >
> >> >Michael
> >>
> >> See tip 6313 in the 'Tips & Tricks' at http://www.jsiinc.com or
> >> pulist.exe (tip 3737)
> >>
> >> set IE=N
> >> for /f "Tokens=1" %%a in ('tasklist^|Find /I "iexplore.exe"') do
> >> (
> >> set IE=Y
> >> )
> >> If "%IE%" EQU "Y" go IEisRunning

>
> > Jerold:
> >
> >
> > Thanks for the link. I have W2K Server SP4 on my laptop and have
> > recently downloaded the support tools which includes "tlist". The
> > link gives some expamples but includes "Tokens" which the batch
> > complains about.

>
> You can change to use "token 2" or just use pslist.ese (Sysinternals)
> and change it from
> ('tasklist^|Find /I "iexplore.exe"')
> to
> ('pslist^|Find /I "iexplore"')
>

 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      5th Jan 2005
10_a_c wrote:
> Thanks for the update. I fumbled around and got it to work with -
>
> tlist|find /i "iexplore.exe"
> if not errorlevel 1 (
> set IE=Y
> goto IEisRunning
> :IEisRunning
> echo inside IEisRunning
> :end


Hi Michael,
you know of conditional execution? This does it shorter:

pslist|find /I "iexplore"&&echo IE running||echo IE not runnning

substitute echo with a goto or whatever you like.

--
Gruesse Greetings Saludos Saluti Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA - checking if a presentation is already open simonc Microsoft Powerpoint 2 22nd May 2008 02:16 PM
Checking for open db John Microsoft ADO .NET 7 7th Aug 2007 11:31 AM
Checking for open db John Microsoft VB .NET 7 7th Aug 2007 11:31 AM
Checking if a query is currently open Mark Microsoft Access Queries 0 24th Aug 2004 04:19 PM
Checking for open workbook... Squid Microsoft Excel Programming 7 28th Feb 2004 01:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:54 AM.