@ECHO OFF
REM Standard AutoExec Batch File

set DOSDRV=$FDRIVE$
set DOSDIR=$FTARGET$
set LANG=$FLANG$
set TZ=$TZ$
set PATH=%dosdir%\BIN
if exist %dosdir%\LINKS\NUL set PATH=%path%;%dosdir%\LINKS
set NLSPATH=%dosdir%\NLS
set HELPPATH=%dosdir%\HELP
set TEMP=%dosdir%\TEMP
set TMP=%TEMP%
set BLASTER=A220 I5 D1 H5 P330
set DIRCMD=/P /OGN /Y
set COPYCMD=/-Y
set OS_NAME=FreeDOS
set OS_VERSION=1.3
set autofile=C:\FDAUTO.BAT
set cfgfile=C:\FDCONFIG.SYS
alias cfg=edit %cfgfile%
alias auto=edit %autofile%
alias reboot=fdapm warmboot
alias reset=fdisk /reboot
alias halt=fdapm poweroff
alias shutdown=fdapm poweroff

if "%config%"=="5" goto END

if not exist %dosdir%\bin\vinfo.com goto Only8086
vinfo /m
if errorlevel 3 goto Support386
if errorlevel 2 goto Support286

:Only8086
MEM /C /N
goto FINAL

:Support286
FDAPM APMDOS
CTMOUSE
MEM /C /N
goto FINAL

:Support386

$LANG_SET$

if "%config%"=="4" goto Support386Low

LH FDAPM APMDOS
rem LH SHARE

rem if EXIST %DOSDIR%\BIN\DOSLFN.COM goto UseLFN
goto NoLFN
:UseLFN
LH %DOSDIR%\BIN\DOSLFN.COM
set DIRCMD=%DIRCMD% /LFN
:NoLFN

CTMOUSE
goto InitCDROM

:Support386Low
FDAPM APMDOS
CTMOUSE

:InitCDROM
if not exist %dosdir%\bin\cdrom.bat FINAL
echo.
call %dosdir%\bin\cdrom.bat

:FINAL
MEM /C /N
echo.
if not exist %dosdir%\bin\fdnet.bat goto NoNetwork
call %dosdir%\bin\fdnet.bat start
if errorlevel 1 goto NoNetwork
REM Custom networking stuff once packet driver has loaded

:NoNetwork

if exist %dosdir%\bin\fdassist.bat call %dosdir%\bin\fdassist.bat
if exist %dosdir%\bin\cdrom.bat call %dosdir%\bin\cdrom.bat display
if exist %dosdir%\bin\welcome.bat call %dosdir%\bin\welcome.bat

:END
