@Echo off

REM ----------------------------------------------------------------------------
REM #Description: Script for purge fccCashe
REM #New: 21.09.2016 /J.Fes first version
REM #LUp: 07.02.2017 /J.Fes update to new version of TcPrompt_Custom.cmd
REM ----------------------------------------------------------------------------

setlocal

rem --#toDo: setup default "#TcSiteId#"
set TcSiteId=

rem --#Doc: Check if P1 = TcSiteId is given by command line
if "%~1"        neq "" set TcSiteId=%~1
if "%~2"        neq "" set ProcessMode=%~2
if "%TcSiteId%" neq "" goto :Start


 rem #Doc: script section below is for check if Edit is done
 Echo ---------------------------------------------------------------------------
 Echo befor use please setup:
 Echo %0
 Echo after Return Edit of stript starts with Notepad
 pause
 start "Edit '%~0'" Notepad "%~0"

 exit
 Echo ---------------------------------------------------------------------------


:Start
 rem --#Doc: set path
 set CmdCurRoot_DP=%~dp0
 set CmdCurRoot_DP=%CmdCurRoot_DP:~0,-1%
 set path=%CmdCurRoot_DP%;%CmdCurRoot_DP%\..\_CustomDefaults\TcPrompt;%CmdCurRoot_DP%\..\_JobMgrDefaults;%path%
 @cd /d "%temp%"
 Echo ---------------------------------------------------------------------------
 Echo before get tc prompt for %TcSiteId%
 Call "%CmdCurRoot_DP%\..\_CustomDefaults\TcPrompt\TcPrompt_Custom.cmd" "%TcSiteId%"
 Echo ---------------------------------------------------------------------------
 Echo FMS_HOME........................: %FMS_HOME%
 Echo ---------------------------------------------------------------------------
 Echo fcc status before purge on \\%ComputerName%
 call fccstat -x
 Echo fcc performe -clear on \\%ComputerName%
 call fccstat -clear
 Echo fcc performe -purge on \\%ComputerName%
 call fccstat -purge
 Echo fcc status after purge on \\%ComputerName%
 call fccstat -config
 call fccstat -x
 if /I "%ProcessMode%" neq "BATCH" pause
endlocal
