:: file:sel.cmd v1.0.0 docs at the end
:: HIDE OUTPUT
@ECHO OFF
:: START THIS SCRIPT MINIMIZED
IF NOT DEFINED CMDWindow Set CMDWindow=%1&Start "Window SELECT" /MIN %0&Goto :EOF
:: GET THE FIRST COMMAND LINE PARAMETER WHICH IS THE STRING TO SEARCH FOR
:: FROM THE ALL WINDOWS TITLS WHICH ARE OPENED ON THE WINDOWS TASKBAR
set _StrToSearchFromWindowsTitlle="%CMDWindow%"
:: DEBUG echo the _StrToSearchFromWindowsTitlle is %_StrToSearchFromWindowsTitlle%
:: DEBUG PAUSE
:: DEBUG ECHO RUNNING : cmd /c "for /f %%i in ('cmdow /T ^| grep -i %_StrToSearchFromWindowsTitlle% ^| cut -f 1 -d ^" ^"') do cmdow %%i /ACT /MAX"
:: DEBUG PAUSE
:: FOR EACH HANDLE OF THE OPENED WINDOWS ON THE TASKBAR , CHOOSE THE ONE WHICH HAS THE
:: STRING TO SEARCH FOR, MAKE IT ACTIVE AND MAXIMIZE IT
for /f %%i in ('cmdow /T ^| grep -i %_StrToSearchFromWindowsTitlle% ^| cut -f 1 -d " "') do cmdow %%i /ACT /MAX
:: DEBUG PAUSE
:: NOW EXIT
exit
:: Purpose
:: to select and maximize the last window on the task bar having a string to search for
::
:: USAGE:
:: put in your windows path: call by , Start - Run - type : sel Opera
:: expected result it will select the latest Opera instances which is opened on the task bar
::
:: DEBUGGING
:: find and replace the ":: DEBUG " with ":: DEBUG \n" with regex options on
::
:: REQUIREMENTS
:: Windows XP and above
:: google download cmdow
:: a virus scanner not treating cmdow as virus !!! F-Secure does ...
:: google download win gnu utils grep
:: google download win gnu utils cut
::
:: VersionHistory
:: 1.0.0 --- 2012-11-15 07:54:17 --- ysg --- Initial version
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!