rem ***********************************************************************************
rem puts an APP WINDOW ON TOP using NirCmd
rem first parameter %1 is the app filename
rem maximizes an APP WINDOW if second parameter %2 is MAX
rem %~dp0 is the directory of the batch - NirCmd.exe must exist in the SAME directory 
rem ***********************************************************************************

if %1.==. exit

rem if the app exists
if not exist "%~dp0NirCmd.exe" exit

rem 2 different modes by second parameter 
if %2.==MAXIMIZE. goto MAXIMIZE

rem 2 different modes by second parameter 
if %2.==MAX. goto LEGACY

rem mode 1 - window gets focus 
start " " "%~dp0NirCmd.exe" win activate process %1
exit

:MAXIMIZE
rem mode 2 - window is maximized
start " " "%~dp0NirCmd.exe" win max process %1
exit

:LEGACY
echo off
echo.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo.
echo !!  ALTER PARAMETER (MAX) - pruefe den Code  !!
echo.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo.
echo.
pause
