anchor.diff:  :files_loop
           REM # no more parameters remaining?
           IF "%~1" == "" GOTO :files_continue
  -
  -        REM # by default this is where we'll assume the file is
  -        SET "FILE=%PWADS%\%~1"
   	
  -        REM # check file extension:
  +	REM # check the previous directory used; we will prefer WADs in the same
  +	REM # directory as the PWAD, over WADs from the base PWAD directory
  +	IF NOT "%PREV_DIR%" == "" (
  +		IF EXIST "%PREV_DIR%\%~1" SET "FILE=%PREV_DIR%\%~1" & GOTO :file_found
  +	)
  +	REM # check the default PWAD directory
  +	SET "FILE=%PWADS%\%~1"
  +	IF EXIST "%FILE%" GOTO :file_found
  +	REM # also check the directory that called this script
  +	SET "FILE=%OLD_DIR%\%~1"
  +	IF EXIST "%FILE%" GOTO :file_found
  +        REM # check the engine directory
  +	SET "FILE=%ENGINE_DIR%\%~1"
  +        IF EXIST "%FILE%" GOTO :file_found
  +	
  +	:file_missing
  +        REM # file cannot be found!
  +	ECHO:
  +	ECHO  ERROR: The specified file does not exist:
  +	ECHO:
  +	ECHO     "%~1"
  +	ECHO:
  +	ECHO  The following locations were checked:
  +	ECHO:
  +	IF NOT "%PREV_DIR%" == "" (
  +		ECHO 	 "%PREV_DIR%\%~1"
  +	)
  +	ECHO 	 "%PWADS%\%~1"
  +	ECHO 	 "%OLD_DIR%\%~1"
  +	ECHO 	 "%ENGINE_DIR%\%~1"
  +	ECHO:
  +	ECHO  Command:
  +	ECHO:
  +	ECHO     doom.bat %*
  +	ECHO:
  +	POPD
  +	PAUSE
  +	EXIT /B 1
  +	
  +	:file_found
  +	REM # is the file a DeHackEd script?
   	IF /I "%~x1" == ".deh" GOTO :deh
   	IF /I "%~x1" == ".bex" GOTO :bex
  -	IF    "%~x1" == ""     GOTO :noext
  -	
  -	REM ------------------------------------------------------------------------------------------------------------
  -	
  -	REM # check the previous directory used
  -	IF NOT "%PREV_DIR%" == "" (
  -		REM # this will fool the next few lines
  -		IF EXIST "%PREV_DIR%\%~1" SET "FILE=%PREV_DIR%\%~1"
  -	)
  -        REM # if the file doesn't exist, check the engine directory
  -        IF NOT EXIST "%FILE%" SET "FILE=%ENGINE_DIR%\%~1"
  -	REM # also check the directory that called this script
  -	IF NOT EXIST "%FILE%" SET "FILE=%OLD_DIR%\%~1"
  -        REM # finally, is it really there?
  -        IF NOT EXIST "%FILE%" (
  -                ECHO:
  -                ECHO  ERROR: the file "%~1" doesn't exist in either the "%PWADS%" folder,
  -                ECHO         or the "%ENGINE_DIR%" folder.
  -		ECHO:
  -                ECHO  Command:
  -                ECHO:
  -                ECHO     doom.bat %*
  -                ECHO:
  -		ECHO %CD%
  -		POPD
  -                PAUSE
  -                EXIT /B 1
  -        )
   	
           SET FILES=%FILES% "%FIX_PATH%\%FILE%"
   	CALL :prev_dir "%FILE%"
  
positive.code: 	:deh
  	REM ------------------------------------------------------------------------------------------------------------
  	REM # load a DeHackEd extension:
  	
  	REM # does it exist in the previously used directory?
  	IF NOT "%PREV_DIR%" == "" (
  		IF EXIST "%PREV_DIR%\%~1" SET "FILE=%PREV_DIR%\%~1"
  	)
  	REM # if the file doesn't exist, check the engine directory
  	IF NOT EXIST "%FILE%" SET "FILE=%ENGINE_DIR%\%~1"
  	REM # finally, is it really there?
  	IF NOT EXIST "%FILE%" GOTO :deh_error
  	
  	REM # accept the file
  	SET DEH=%DEH% "%FIX_PATH%\%FILE%"
  	CALL :prev_dir "%FILE%"
  	SET ANY_DEH=1
  
negative.code: 	ECHO             Steam : DOOM Classic Complete - ^(all of the above^)
  	ECHO       GOG / Steam : DOOM 3 BFG Edition    - DOOM.WAD ^& DOOM2.WAD
  	ECHO               GOG : The Ultimate DOOM     - DOOM.WAD
  	ECHO               GOG : DOOM II + Final DOOM  - DOOM2.WAD, TNT.WAD ^& PLUTONIA.WAD
  	ECHO             Steam : Heretic               - HERETIC.WAD
  	ECHO             Steam : Hexen                 - HEXEN.WAD
          ECHO:
  	ECHO     %_HEADING_%Shareware:%_%
  	ECHO:
  