rem #New: 30.05.2014/J.Fes TC_SHARED_MEMORY_DIR
rem #LUp: 29.10.2024/J.Fes TC_SHARED_MEMORY_DIR
rem #LUp: 20.10.2025/J.Fes add #EXA + Echo2

rem #Exa: call TcSharedMemoryDirOrg.cmd "ON"
rem #Exa: call TcSharedMemoryDirOrg.cmd "OFF"


 set TC_SHARED_MEMORY_DIR_Enable=%~1
 Call Echo2 "TC_SHARED_MEMORY_DIR set" "%TC_SHARED_MEMORY_DIR_Enable%"
 if /i "%TC_SHARED_MEMORY_DIR_Enable%" equ "ON" call :TC_SHARED_MEMORY_DIR_Enable
 if /i "%TC_SHARED_MEMORY_DIR_Enable%" neq "ON" call :TC_SHARED_MEMORY_DIR_Disable
:MyEnd
goto :eof

:TC_SHARED_MEMORY_DIR_Disable
 rem disable TC_SHARED_MEMORY_DIR, via:
 set TC_NO_TEXTSRV_SHARED_MEMORY=TRUE
 set TC_USE_METADATA_SHARED_MEMORY=FALSE
 set TC_USE_PREFS_SHARED_MEMORY=FALSE
 set TC_SHARED_MEMORY_DIR=
 Call Echo2 "TC_SHARED_MEMORY_DIR" "Enabled:NO"
 goto :eof

:TC_SHARED_MEMORY_DIR_Enable
 rem enable SHARED_MEMORY via set TC_SHARED_MEMORY_DIR=%CmdCurRoot_DP%\..\TC_SHARED_MEMORY_%TcSiteId%\
 call Parse_Absolut_DP.cmd TC_SHARED_MEMORY_DIR "%CmdCurRoot_DP%\..\TC_SHARED_MEMORY_%TcSiteId%\"
 if not exist "%TC_SHARED_MEMORY_DIR%" md "%TC_SHARED_MEMORY_DIR%"
 Call Echo2 "TC_SHARED_MEMORY_DIR" "Enabled:YES"
 Call Echo2 "TC_SHARED_MEMORY_DIR" "%TC_SHARED_MEMORY_DIR%"
 goto :eof
