@echo off

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
if "%OS%"=="FREEDOS" 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% -l- -Q -w edit %1 %2 %3 %4 %5 %6 %7 %8 %9
goto end

:usage
echo.
echo Usage:  %0  filename  [other 'edit' parameters]
echo.
echo      filename     : Name of a file to be edited in binary (HEX/ASCII)
echo.
echo      -p:pos       : Position of cursor on initial file sector loaded
echo.
echo      -M:position  : start position of an initial marked area in edit window
echo      -m:bytes     : size in bytes for initial marked area (see Alt-B/L/U/F)
echo      -s:size      : size of each item to be edited (default is 1 sector)
echo      -c:cols      : number of columns in edit dlg  (default 8, 16 or 32)
echo      -r:rows      : number of rows in edit dialog  (default whole screen)
echo      -d           : start in alternate, disassembler view, maximized
:end
