@echo off
rem 11-03-2004 JvW Derived from DFSUNFD, check ONE partition      (6.04)
rem 05-10-2004 JvW Use new internal DFSCHECK DFSee command        (6.14)
echo.
echo Get information on filesystem for partition %1 %2

if exist _write_._ok del _write_._ok > NUL
echo test > _write_._ok
if exist _write_._ok goto writeok
echo.
echo ERROR: The current directory is write-protected or the disk is full
echo.
echo        Please change the current directory to a disk or diskette
echo        with more than 100Kb of available space ...
echo.
goto end
:writeok
if exist _write_._ok del _write_._ok > NUL

if "%0"=="DFSCTEST"     echo on
if "%0"=="dfsctest"     echo on

if "%OS2_SHELL%"=="" goto notos2
set dfsexe=dfsos2.exe
set cmdext=CMD
goto dfsee
:notos2
if "%OS%"==""        goto notnt
if "%OS%"=="DOS"     goto notnt
if "%OS%"=="MSDOS"   goto notnt
if "%OS%"=="DRDOS"   goto notnt
if "%OS%"=="IBMDOS"  goto notnt
if "%OS%"=="OPENDOS" goto notnt
set dfsexe=dfswin.exe
set cmdext=BAT
goto dfsee
:notnt
set dfsexe=dfsdos.exe
set cmdext=BAT
:dfsee

if "%1" == ""    goto usage
if "%1" == "?"   goto usage
if "%1" == "/?"  goto usage
if "%1" == "-?"  goto usage

%dfsexe% -b -q query RValid
if not errorlevel 1 goto work
echo.
echo NOTE: Your DFSee version is not properly registred, this will cause
echo       some extra delays and reminder messages to be displayed  ...
echo.

:work
%dfsexe% -batch dfscheck %1 %2

:showerrors
if errorlevel 235 goto failure
if errorlevel 234 goto noscript
if errorlevel 001 goto failure

echo.
echo Resulting DFSee check logfiles:
dir dfsc*.p*
echo.
echo email file(s) to support@dfsee.com for analysis (ZIP if possible)
echo Include as many details about any perceived problem as you can.
echo.
goto end

:noscript
echo.
echo ERROR: The required DFSee script 'DOxxxx.dfs' was not found.
echo Either the type is NOT supported, or the script is missing.
echo Check if it is in the current directory, the same directory
echo as the execuatable %dfsexe% or a directory on the PATH.
goto end

:failure
echo.
echo WARNING: Execution of the script seems to have failed.
echo.
echo Check if %dfsexe% and the script file 'DOxxxx.dfs' can be
echo found in the current directory, or a directory on the PATH.

:usage
%dfsexe% dfscheck -?
:end
