set local
@echo off


rem Check for Reservation Confirmations in RESERVATION 3.2 and recalculate queue leaders in case of missing confirmations
rem =====================================================================================================================

rem YOU HAVE TO ENABLE ONE LINE TO SEE OUTPUT IN DOS WINDOW WHEN YOU START THE FILE MANUALLY (SEE BELOW)


rem Determine the current directory:

cls
for /F "tokens=*" %%A in ('cd') do set cwd=%%A


rem YOU HAVE TO SET the virtual directory where reservation_check_queue.asp resides:

set webdir=http://localhost/<your_virtual_directory>/reservation_check_queue_service


rem Call reservation_check_queue.asp with wget.exe (see http://space.tin.it/computer/hherold/index.html#Howto)

rem wget Options used:
rem -a ..\Session.html: append output to Session.html
rem -T 60             : set the network timeout to 60 seconds
rem -t 3              : retry 3 times in case of connection problems
rem -w 3600           : wait 3600 seconds between two retries
rem --ignore-length   : ignore the Content-Length header (use this if problems occur and wget "goes wild")


if exist "%cwd%\reservation_check_queue.asp" (
  date /T         >> Session.html

  echo "wget.exe reservation_check_queue.asp" is being executed...
  "%cwd%\wget.exe" -T 60 -t 3 -w 3600 -a Session.html %webdir%/reservation_check_queue.asp

  rem Use this to see output in DOS window:
  rem "%cwd%\wget.exe" -T 60 -t 3 -w 3600             %webdir%/reservation_check_queue.asp
  
  echo.
  echo reservation_check_queue.bat finished.
  echo Check "Session.html" on the webserver.

  echo "<br><br>" >> Session.html
)

if exist "%cwd%\reservation_check_queue.asp.1" del "%cwd%\reservation_check_queue.asp.1"


rem Marcel A. Hug Informatik GmbH, 21.08.2003

rem pause

@echo on
