Windows API と対話する必要があります。
Autohotkey は、このようなことをすばやく行うのに非常に優れており、バッチ スクリプトから呼び出すことができます。
これには、開いているウィンドウを反復処理するために使用できる WinGet というコマンドが含まれています。
http://www.autohotkey.com/docs/commands/WinGet.htm
以下は、開いているすべてのウィンドウを反復処理するためのドキュメントの例です。
; Example #2: This will visit all windows on the entire system and display info about each of them:
WinGet, id, list,,, Program Manager
Loop, %id%
{
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
WinGetClass, this_class, ahk_id %this_id%
WinGetTitle, this_title, ahk_id %this_id%
MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
IfMsgBox, NO, break
}