TEAM ENVI Dest=8x64|ENVI Targ=%WinDir%\System32
TEAM CALL RestF|CALL CopyF|EXEC =%CurDir%\RecEnv.exe|CALL RestF

_SUB CopyF
TEAM PATH %Targ%\BackRE\en-US|PATH %Targ%\BackRE\ru-RU
FORX /S:1 %Dest%\*.*,TEnvi,0,
{* IFEX %TEnvi%\,EXIT -!TEAM FDIR DEnvi=%TEnvi%|FNAM -ext DEnvi=%DEnvi%
TEAM FNAM -ext TEnvi=%TEnvi%|FIND $%DEnvi%=%Dest%,!ENVI TEnvi=%DEnvi%\%TEnvi%
TEAM SITE ?,DEnvi=%Dest%\%TEnvi%|MSTR DEnvi=1,10,%DEnvi%
TEAM SITE ?,NEnvi=%Targ%\%TEnvi%|MSTR NEnvi=1,10,%NEnvi%
FIND $%DEnvi%=%NEnvi%,!TEAM FILE %Targ%\%TEnvi%->%Targ%\BackRE\%TEnvi%|FILE %Dest%\%TEnvi%=>%Targ%\%TEnvi%
}
_END

_SUB RestF
IFEX %Targ%\BackRE\,PATH %Targ%\DelRE!EXIT 2
FIND wbengine.exe,TEAM KILL wbengine.exe|WAIT 200
FORX * blb_ps.dll ReAgent.dll srcore.dll vss_ps.dll vsstrace.dll wbengine.exe,TEnvi,FILE %Targ%\%TEnvi%
FORX /S:1 %Targ%\BackRE\*.*,TEnvi,0,
{* IFEX %TEnvi%\,EXIT -!TEAM FDIR DEnvi=%TEnvi%|FNAM -ext DEnvi=%DEnvi%
TEAM FNAM -ext TEnvi=%TEnvi%|FIND $%DEnvi%=BackRE,!ENVI TEnvi=%DEnvi%\%TEnvi%
TEAM FILE %Targ%\%TEnvi%->%Targ%\DelRE\%TEnvi%|FILE %Targ%\BackRE\%TEnvi%->%Targ%\%TEnvi%
}
TEAM FILE %Targ%\BackRE|FILE %Targ%\DelRE
_END