setlocal ENABLEDELAYEDEXPANSION
  rem #Example: call wait_for_key.cmd "10" "c" "qi" DoNextKey
  rem #Lup 22.02.2016 / J.Fes
  set waitTime=10
  set choise_default=c
  set choises=c
  if "%~1" neq "" set waitTime=%~1
  if "%~2" neq "" set choise_default=%~2
  if "%~3" neq "" set choises=%choise_default%%~3
  "%~dp0CHOICE.exe" /C %choises% /D %choise_default% /T %waitTime% /M "wait:[%waitTime% sec for default Action:%choise_default%] or select [%choises%] Action: "
  set /a RLevel=%errorlevel%-1
  set return_key_r=!choises:~%RLevel%,1!
endlocal& if "%~4" neq "" set %~4=%return_key_r%

