anchor.diff:  ::
   :: %~1 - the directory's path
   :: %~2 - /P to force prepending to %PATH%, or empty
  +
   :shellenv.select.path
   
   :: Only one of these paths will be appended to %PATH%
  
positive.code: :: are installed by default under %ProgramFiles% and %ProgramFiles(x86)%.
  ::
  :: %~1 - one of them: jdk or jre
  :shellenv.lookup.java
  set "%~1_HOME="
  for /f %%d in ( '
  	dir /b "%ProgramFiles%\Java" "%ProgramFiles(x86)%\Java" 2^>nul ^| findstr "%~1" ^| sort
  
negative.code: :: the specified path, otherwise 0.
  ::
  :: %~1 - the directory's path
  
  :shellenv.check.path
  
  :: Skip if the path is specified in %PATH%
  for %%p in ( "%PATH:;=" "%" ) do if /i "%~1" == "%%~p" exit /b 1
  
  