anchor.diff:  
   :debug.off
   set "DEBUG=0"
  +set "ECHO.D=echo >NUL"
  +set "ECHOVARS.D=echo >NUL"
   goto :debug.common
   :debug.on
   set "DEBUG=1"
  +set "ECHO.D=echo"
  +set "ECHOVARS.D=call :EchoVars"
   :debug.common
  -set "ECHO.D=if %DEBUG%==1 echo"
  -set "ECHOVARS.D=if %DEBUG%==1 call :EchoVars"
  +set "FUNCTION=call %ECHO.D% call %%0 %%*&setlocal"
   exit /b
   
   :EchoVars	%1=VARNAME %2=VARNAME %3=VARNAME ...
  
positive.code: 
  :# Get the default python.exe executable
  :GetPythonExe %1=VARNAME
  %ECHO.D% :GetPythonExe %1
  call :GetOpenCommand Python.File %1
  if defined %~1 call call :GetArg0 %%1 %%%~1%%
  %ECHOVARS.D% %1
  
negative.code: 
  :# Get a list of all python.exe executables
  :GetAllPythonExe %1=LISTNAME
  %FUNCTION% EnableDelayedExpansion
  set "LIST=" &:# List of instances found.
  
  :# First list the default instance
  call :GetPythonExe DEFAULT
  set "SHORT_DEFAULT=" &:# Short version of the same, used to avoid reporting it twice.
  if defined DEFAULT for %%p in ("!DEFAULT!") do (
    set "SHORT_DEFAULT=%%~sp"
    call :lappend LIST "%%~fp"
  )
  
  :# Then list py.exe if it's not the default
  if defined DEFAULT for %%p in ("%DEFAULT%") do if not "%%~nxp"=="py.exe" (
    for %%x in (py.exe) do set "PY=%%~$PATH:x"
    if defined PY for %%p in ("!PY!") do (
      call :lappend LIST "%%~fp"
    )
  )
  
  :# Then list all instances that match the requested criteria
  call :GetAllPythonDirs ALL_DIRS
  for %%d in (%ALL_DIRS%) do (
    for %%p in ("%%~d\python.exe") do (
      if not "%%~sp"=="%SHORT_DEFAULT%" (
        call :lappend LIST "%%~fp"
      )
    )
  )
  
  endlocal & set %~1=%LIST%
  %ECHOVARS.D% %~1
  exit /b
  
  :# Get a list of all python.exe installation directories in well known places
  :GetAllPythonDirs %1=LISTNAME
  %FUNCTION% EnableDelayedExpansion
  set "LISTNAME=%~1"
  set "DRIVES=C:"		&:# List of drives where to search for python.exe
  if not "%HOMEDRIVE%"=="C:" set "DRIVES=%HOMEDRIVE% %DRIVES%" &:# Prepend the home drive, if it's different
  for /f "tokens=1" %%d in ('net use ^| findstr /C:"\\vmware-host\Shared Folders\\"') do ( :# And append VM host drives, if any
    if exist "%%d%ProgramFiles:~2%" set "DRIVES=!DRIVES! %%d"
  )
  %ECHOVARS.D% DRIVES
  set "LIST="
  if not defined ProgramFiles(x86) set "ProgramFiles(x86)=%ProgramFiles% (x86)" &:# For x86 VMs searching on amd64 hosts
  for %%d in (%DRIVES%) do (
    rem :# The default install dir is %LOCALAPPDATA%\Programs\Python\Python%VER% for the current user,
    rem :# Or %ProgramFiles%\Python%VER% or %ProgramFiles(x86)%\Python%VER% for all users.
    for %%p in ("" "%ProgramFiles:~2%" "%ProgramFiles(x86):~2%" "%LOCALAPPDATA:~2%\Programs") do (
      for %%y in ("Python" "Python\Python" "Microsoft Visual Studio\Shared\Python") do (
        for /d %%b in ("%%d%%~p\%%~y*") do (
  	%ECHO.D% :# Looking in %%~b
  	for %%x in ("%%~b\python.exe") do if exist "%%~x" (
  	  if defined LISTNAME (
  	    call :lappend LIST "%%~b"
  	  ) else (
  	    set "B=%%~b"
  	    echo !B!
  	  )
  	)
        )
      )
    )
  )
  if defined LISTNAME (
    set SET_RESULT=set %LISTNAME%=%LIST%
    %ECHO.D% !SET_RESULT!
  ) else (
    set SET_RESULT=rem
  )
  endlocal & %SET_RESULT%
  exit /b
  
  :# Enumerate pip.exe instances
  :EnumPip %1=Optional instance to search; %2=Output variable name
  %FUNCTION% EnableDelayedExpansion
  call :GetAllPythonExe ALL_PYTHON
  set "WANT_INDEX=%~1"
  set "OUTVAR=%~2"
  set "FOUND="
  set "N=0"
  set ^"PY_VER_ARCH_CMD=import sys, os; print (sys.version.split()[0]+\" \"+os.environ[\"PROCESSOR_ARCHITECTURE\"])^"
  for %%e in (!ALL_PYTHON!) do (
    set "PY_VER=" & set "PY_ARCH="
    for /f "tokens=1,2" %%v in ('^"%%e -c "!PY_VER_ARCH_CMD!" 2^>NUL^"') do set "PY_VER=%%v" & set "PY_ARCH=%%w"
    if defined PY_VER if defined PY_ARCH (
      set "PY_DIR=%%~dpe" & set "PY_DIR=!PY_DIR:~0,-1!"
      %ECHOVARS.D% PY_VER PY_ARCH PY_DIR
      if exist "!PY_DIR!\py.exe" if not exist "!PY_DIR!\Scripts\pip.exe" (
        :# Find the actual python instance that py.exe runs by default
        for /f "delims=" %%p in ('^""!PY_DIR!\py.exe" -c "import sys; print (sys.executable)"^"') do (
        	set "PY_DIR=%%~dpp" & set "PY_DIR=!PY_DIR:~0,-1!"
        )
      )
      set "FOUNDX="
      :# Python 2.7 installs a pip.bat script, but no pip.exe command
      :# Python 3.5 installs a pip3.bat script, but no pip.exe or pip.bat
      for %%p in (pip.exe pip.bat pip3.bat) do (
        if not defined FOUNDX for %%p in ("!PY_DIR!\Scripts\%%p") do if exist %%p (
        	set "FOUNDX=1"
  	set "INDEX_=!N!       "
  	set "PY_VER_=!PY_VER!       "
  	set "PY_ARCH_=!PY_ARCH!       "
  	if defined OUTVAR (
  	  if "!N!"=="!WANT_INDEX!" (
  	    set "FOUND=%%~p"
  	    goto :EnumPip.exit
  	  )
  	) else (
  	  echo #!INDEX_:~0,3! !PY_VER_:~0,8! !PY_ARCH_:~0,7! %%~p
  	)
        )
      )
      set /a "N+=1"
    )
  )
  :EnumPip.exit
  set "SET_VAR=rem"
  if defined OUTVAR set ^"SET_VAR=set "%OUTVAR%=%FOUND%"^"
  endlocal & %SET_VAR% & %ECHOVARS.D% %OUTVAR%
  exit /b 0
  
  :#----------------------------------------------------------------------------#
  :# Main routine
  