echo off
cls
copy good result >nul

if "%1"=="1" goto x00off0
if "%1"=="2" goto x00off1
if "%1"=="3" goto x00off2
if "%1"=="4" goto x00off3

:x00off0
XU PORT:0:OFF
goto resume

:x00off1
XU PORT:1:OFF
goto resume

:x00off2
XU PORT:2:OFF
goto resume

:x00off3
XU PORT:3:OFF

:resume
if "%4"=="F" goto fifo
dsz port %1 speed %2 D pR1 rz %3
goto nofifo
:fifo
dsz F port %1 speed %2 D pR1 rz %3
:nofifo
if errorlevel 1 copy bad result >nul

if "%1"=="1" goto x00on0
if "%1"=="2" goto x00on1
if "%1"=="3" goto x00on2
if "%1"=="4" goto x00on3

:x00on0
XU PORT:0:ON
goto end

:x00on1
XU PORT:1:ON
goto end

:x00on2
XU PORT:2:ON
goto end

:x00on3
XU PORT:3:ON
:end
