I've got Microsoft Outlook, Internet Explorer, Mozilla Firefox, and a
couple of open console windows on my desktop. I run the following
code:

set oShApp = CreateObject("Shell.Application")
wscript.echo "starting..."
for each oWin in oShApp.windows
set oDoc = oWin.document
wscript.echo oDoc.title
next
wscript.echo "done."

It returns only the Internet Explorer window title. How should I
modify it to return the titles of all the windows? Thanks in advance
to all who respond.

Leslie

Re: Enumerating ALL windows? by Torgeir

Torgeir
Wed Oct 06 11:45:07 CDT 2004

Leslie Houk wrote:

> I've got Microsoft Outlook, Internet Explorer, Mozilla
> Firefox, and a couple of open console windows on my desktop.
> I run the following code:
>
> set oShApp = CreateObject("Shell.Application")
> wscript.echo "starting..."
> for each oWin in oShApp.windows
> set oDoc = oWin.document
> wscript.echo oDoc.title
> next
> wscript.echo "done."
>
> It returns only the Internet Explorer window title. How should
> I modify it to return the titles of all the windows?
Hi

Enum.exe, Cmdow.exe, or JSSys.dll is an option:

http://groups.google.com/groups?threadm=O%24R%23LR4YEHA.3688%40TK2MSFTNGP12.phx.gbl



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx