@echo off
rem 09-08-2016 JvW Use 'dfsrunas.exe' to elevate Windows to admin, ignoring explicit window sizes
rem 10-08-2016 JvW Removed write-test and registration-test, does not work with 'dfsrunas'
echo.
echo Get information on filesystem for partition %1 %2

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

ver | findstr /i /C:"XP [" > nul
if %errorlevel% EQU 0 goto winxpnt
ver | findstr /i /C:"Version 5" > nul
if %errorlevel% EQU 0 goto winxpnt
ver | findstr /i /C:"NT [" > nul
if %errorlevel% EQU 0 goto winxpnt
ver | findstr /i /C:"Version 4" > nul
if %errorlevel% EQU 0 goto winxpnt

echo.
echo Wait until the CHECK procedure in a seperate window has completed ...
set dfsexe=dfsrunas -c -w dfswin.exe
set cmdext=BAT
set ckname=dfsw
goto dfsee

:winxpnt
set dfsexe=dfswin.exe
set cmdext=BAT
set ckname=dfsw
goto dfsee

:notnt
set dfsexe=dfsdos.exe
set cmdext=BAT
set ckname=dfsd

:dfsee

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

:work
%dfsexe% -b -w -t dfscheck %1 %2

echo.
echo Resulting DFSee check logfiles:
dir %ckname%*.b*%1 %ckname%*.i*%1 %ckname%*.p*%1
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

:usage
%dfsexe% dfscheck -?
echo.
echo You can use the '-screen-' option to the command to prevent
echo the final completion message, requiring manual confirmation.
echo.

:end
pause
