Re: enumerating top level windows

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 07/06/04


Date: Tue, 06 Jul 2004 20:27:02 +0200

Gary Roach wrote:

> i want to enumerate top level windows using a script. i've already looked at
> Karl Peterson's site for vb
> (http://www.mvps.org/vb/index2.html?samples.htm). i'm wondering if the same
> thing can be accomplished using wmi. all i can find is the ability to
> enumerate processes. i want top level windows so that i can close apps. any
> idea how to do this? thanks,
Hi

Nothing builtin you can access from a script can do this.

Here us two free command line utilities you can e.g. run from a network
share, nothing needs to be installed on the local computer if you don't
want to. You can e.g. redirect the output to a temporary file and parse
it from your vbscript.

CMDOW Commandline Window Utility (with /T: List only the windows shown
on the taskbar)
http://www.commandline.co.uk/cmdow/index.html

Enum.exe in the Command Line Tools (CMDLINE.ZIP), lists all visible
top-level windows
http://www.cmdtools.com/

-- 
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/community/scriptcenter/default.mspx


Relevant Pages

  • Re: Lost System Information
    ... When I access it I have box open with words Cant Collect information, and more stating Cannot access Windows Management instrumentation software, Windows Management files may be moved or missing! ... To delete the WMI repository: ... If the suggestions and methods shown there fail to repair things then the only other fix that I know of is an in-place upgrade of the operating system. ... UpgradeRepository command doesn't help proceed to the next step and re-register the WMI components: ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Lost System Information
    ... and more stating Cannot access Windows ... To delete the WMI repository: ... How to perform an in-place upgrade of Windows XP ... UpgradeRepository command doesn't help proceed ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Windows error message
    ... > MS-DOS andMicrosoft Windows applications. ... Error message when you install or start an MS-DOS or 16-bit ... In the command prompt, type in the following two commands exactly as ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)
  • Re: SP2 &16 bit programs
    ... The system file is not suitable for running MS-DOS and MS Windows applications... ... WinXP SP2 and AVAST installed, ... In the command prompt, type in the following two commands exactly as ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsxp.general)
  • Re: Lost System Information
    ... and more stating Cannot access Windows ... To delete the WMI repository: ... How to perform an in-place upgrade of Windows XP ... UpgradeRepository command doesn't help proceed ...
    (microsoft.public.windowsxp.help_and_support)