anchor.diff:  REM so a non-existent command will result in a non-zero
   REM errorlevel
   
  -systeminfo 2>1 > nul 
  -if %errorlevel% neq 0 goto notXP
  -
  -for /f "delims= skip=2" %%i in ( 'reg query HKEY_LOCAL_MACHINE\SOFTWARE\wkhtmltopdf /v PdfPath' ) do set "wkhtml=%%i".
  -set "wkhtml=%wkhtml:~19%"
  -
  -for /f "delims= skip=2" %%i in ( 'reg query HKEY_LOCAL_MACHINE\SOFTWARE\GnuWin32\Wget\1.11.4-1\setup /v InstallPath' ) do set "wget=%%i"
  -set "wget=%wget:~23%\bin\wget"
  +systeminfo > nul 2>&1
  +if %errorlevel% equ 0 goto :notXP
  +
  +call :checkWkhtmlXP
  +call :checkWgetXP
  +goto :installChecks
   
   :notXP
   
  -systeminfo 2>1 | find "Windows Directory" > %tmp_file%
  -for /f "tokens=3 delims= " %%i in ( 'type %tmp_file% ') do set tmp=%%i
  -for /f "tokens=1 delims=:" %%i in ( 'echo %tmp%' ) do set windrive=%%i
  -for /f "delims=" %%i in ( 'where /R %windrive%:\ wkhtmltopdf.exe' ) do set "wkhtml=%%i"
  -for /f "delims=" %%i in ( 'where /R %windrive%:\ wget.exe' ) do set "wget=%%i"
  +call :getWindowsDrive
  +call :checkWkhtmlNotXP %windrive%
  +call :checkWgetNotXP %windrive%
  +
  +:installChecks
   
   if "-%wkhtml%-" == -- (
   	echo Please download and install "%wkhtml%" >> %output_log_file%
  
positive.code: set delay=2
  set blip_entries_dir=.\blip_entries
  
  
  if not exist %blip_entries_dir% (
  	echo Making directory %blip_entries_dir%
  	mkdir %blip_entries_dir%
  	if %errorlevel% neq 0 (
  		echo Failed to make directory %blip_entries_dir%
  		exit /b
  	)
  )
  
  REM Check that wkhtml and wget are installed
  
  
negative.code: endlocal
  REM Return from call
  exit /b
  
  :getWindowsDrive
  setlocal
  systeminfo 2>&1 | find "Windows Directory" > %tmp_file%
  for /f "tokens=3 delims= " %%i in ( 'type %tmp_file% ') do set tmp=%%i
  for /f "tokens=1 delims=:" %%i in ( 'echo %tmp%' ) do set result=%%i
  del %tmp_file%
  endlocal & set "windrive=%result%"
  exit /b
  
  :checkWkhtmlXP
  setlocal
  for /f "delims= skip=2" %%i in ( 'reg query HKEY_LOCAL_MACHINE\SOFTWARE\wkhtmltopdf /v PdfPath' ) do set "result=%%i"
  set "result=%result:~19%"
  endlocal & set "wkhtml=%result%"
  exit /b
  
  :checkWkhtmlNotXP
  setlocal
  for /f "delims=" %%i in ( 'where /R %1%:\ wkhtmltopdf.exe' ) do set "result=%%i"
  endlocal & set "wkhtml=%result%"
  exit /b
  
  :checkWgetXP
  setlocal
  for /f "delims= skip=2" %%i in ( 'reg query HKEY_LOCAL_MACHINE\SOFTWARE\GnuWin32\Wget\1.11.4-1\setup /v InstallPath' ) do set "wget=%%i"
  set "result=%result:~23%\bin\wget"
  endlocal & set "wget=%result%"
  exit /b
  
  :checkWgetNotXP
  setlocal
  for /f "delims=" %%i in ( 'where /R %1%:\ wget.exe' ) do set "result=%%i"
  endlocal & set "wget=%result%"
  exit /b
  