@Echo off

set CmdCurRoot=%~dp0
set CmdCurRoot=%CmdCurRoot:~0,-1%
set NxCheckBox_Exe_DPNE=%~1
set NxCheckBox_Exe_N=%~n1

set UGII_ROOT_DIR=%UGII_BASE_DIR%\ugii
set UGII_NXBIN_DIR=%UGII_BASE_DIR%\NXBIN
set PATH=%UGII_BASE_DIR%;%UGII_NXBIN_DIR%;%UGII_ROOT_DIR%;%CmdCurRoot%;%PATH%

REM Echo path %path%
 echo --------------------------------------------------------------------------
 Echo NX Settings.....................: Details:
 Echo Path............................: %Path%
 Echo UGII_BASE_DIR...................: %UGII_BASE_DIR%
 Echo UGII_NXBIN_DIR..................: %UGII_NXBIN_DIR%
 Echo UGII_ROOT_DIR...................: %UGII_ROOT_DIR%
 Echo NxCheckBox_Exe_DPNE.............: %NxCheckBox_Exe_DPNE%
 pause

if not exist "%NxCheckBox_Exe_DPNE%" goto :ExitErr

 rem --- Help txt ---
 set NxCheckBoxHelp_DPNE=%CmdCurRoot%\NxCheckBox_64_Help.txt
 set NxCheckBoxHelpDoc_DPNE=%CmdCurRoot%\..\Documentation\NxCheckBox_64_Help.txt
 rem execute get help
 call %NxCheckBox_Exe_DPNE%>"%NxCheckBoxHelp_DPNE%"
 set NxCheckBox_ErrLevel=%ERRORLEVEL%

 Echo Copy NxCheckBox Help.txt from...: %NxCheckBoxHelp_DPNE%
 Echo Copy NxCheckBox Help.txt to.....: %NxCheckBoxHelpDoc_DPNE%
 copy "%NxCheckBoxHelp_DPNE%" "%NxCheckBoxHelpDoc_DPNE%"

 echo --------------------------------------------------------------------------
 echo Result:
 Echo  Executing Errorlevel:[%NxCheckBox_ErrLevel%]
 Echo  Type Help
 type "%NxCheckBoxHelp_DPNE%"


Goto :End

REM Type "%NxCheckBoxHelp_DPNE%"
:ExitErr
 Echo err cannot get Help
 Echo Posible Reasons:
 Echo - Parameter P1 not given
 Echo - cannot find NxCheckBox_Exe
 Echo P1 = "%1"
 Echo P2 = "%2"

 goto :end

:End
pause


