@echo off
if %netdir16%.==. goto nonetdir
if %nic16%.==. goto nonetcard
set env_1=%nic16%
set env_2=%netdir16%
for %%a in (u U) do if %1.==%%a. goto unload
for %%a in (u U) do if %1.==/%%a. goto unload
if not %nwclient%.==. goto bereits_geladen
if %ipx%.==1. if %nwclient%.==. goto shell
if %tcpip%.==1. if %nwclient%.==. goto shell
for %%a in (ip Ip IP iP) do if %1.==%%a. set ip=1
for %%a in (ip Ip IP iP) do if %1.==/%%a. set ip=1
for %%a in (ip Ip IP iP) do if %2.==%%a. set ip=1
for %%a in (ip Ip IP iP) do if %2.==/%%a. set ip=1
for %%a in (wfw Wfw WFw WFW WfW wFw wFW wfW) do if %1.==%%a. set wfwnet=1
for %%a in (wfw Wfw WFw WFW WfW wFw wFW wfW) do if %1.==/%%a. set wfwnet=1
for %%a in (wfw Wfw WFw WFW WfW wFw wFW wfW) do if %2.==%%a. set wfwnet=1
for %%a in (wfw Wfw WFw WFW WfW wFw wFW wfW) do if %2.==/%%a. set wfwnet=1
set netcfg=%env_2%\%env_1%.CFG
if %ip%.==1. goto ip
lh /l:3 %env_2%\LSL /C=%netcfg%>c:\netdrv.log
lh /l:2 %env_2%\%env_1%>>c:\netdrv.log
if errorlevel 1 goto notfound
lh %env_2%\IPXODI>>c:\netdrv.log
set ipx=1
if %wfwnet%.==1. %env_2%\odihlp>>c:\netdrv.log
if %wfwnet%.==1. set wfwsup=1
echo.
goto shell

:bereits_geladen
echo.
echo    Bin geladen!
echo.
goto end

:ip
lh /l:2 %env_2%\LSL /C=%netcfg%>c:\netdrv.log
lh /l:2 %env_2%\%env_1%>>c:\netdrv.log
if errorlevel 1 goto nonetcard
lh %env_2%\tcpip>>c:\netdrv.log
if errorlevel 1 goto tcpiperror
lh %env_2%\nwip>>c:\netdrv.log
echo.
%env_2%\ping reksio
echo.
echo    TCP/IP bound to %env_1%.
echo    Frame=Ethernet_II
echo.
set tcpip=1
if %wfwnet%.==1. %env_2%\odihlp>>c:\netdrv.log
if %wfwnet%.==1. set wfwsup=1
goto shell

:shell
:if not %ip%.==1. lh %env_2%\VLM /mx /v4>>c:\netdrv.log
:if %ip%.==1. %env_2%\VLM /mx /v4>>c:\netdrv.log
%env_2%\VLM /mx /v4>>c:\netdrv.log
set nwclient=16
:doskey win=echo         Neustart!!!
goto end

:nonetcard
echo.
echo    No NIC defined !
echo    Set the variable NIC16 like your network card!
echo.
goto end

:notfound
echo.
echo    %env_1% not found !
echo.
%env_2%\lsl u
echo.
goto end

:nonetdir
echo.
echo	Kein Client Verzeichnis definiert!
echo.
goto end

:wfwsup
echo.
echo    Der Treiber ODIHLP fr die Untersttzung von WfW-Netzwerken ist geladen.
echo    Es kann nur der NetWare Client aus dem Speicher entfernt werden.
echo.
goto unloadvlm

:tcpiperror
echo.
echo    NetWare/IP Server not found !
echo.
%env_2%\%env_1% u>>c:\netdrv.log
%env_2%\LSL u
echo.
goto end

:unload
if %wfwsup%.==1. goto wfwsup
:unloadvlm
c:
if %nwclient%.==16. %env_2%\vlm /u>>c:\netdrv.log
set nwclient=
if %wfwsup%.==1. goto end
set wfwsup=
if %tcpip%.==1. %env_2%\nwip /u>>c:\netdrv.log
if %tcpip%.==1. %env_2%\tcpip /u>>c:\netdrv.log
set tcpip=
if %ipx%.==1. %env_2%\ipxodi /u>>c:\netdrv.log
set ipx=
%env_2%\%env_1% /u>>c:\netdrv.log
%env_2%\lsl /u
set ip=
doskey login=
doskey logout=
goto end

:end
:resetenv
set env_1=
set env_2=
