Код работал, сортировка проводилась.
Код:

@Echo On
setlocal enableextensions enabledelayedexpansion
cls
path c:\windows\system32
Set sourcedir=e:\Rabota\GNI\OUT\
Set sourcedir1=e:\Rabota\GNI\OUT\A\
Set sourcedir2=e:\Rabota\GNI\OUT\AN\
Set sourcedir3=e:\Rabota\GNI\OUT\BN\
Set sourcedir_arh=e:\Rabota\GNI\OUT\Arhiv\
Set destdir1=d:\Rabota\GNI_Test\ARHIV\
Set destdir2=e:\Rabota\GNI\ARHIV\
Set log=d:\Rabota\GNI_Test\Log\
Set files1=SBC*.txt
Set files2=SBC*.xml
Set files3=SFC*.xml
for /f "tokens=1-3*" %%a in ('dir "%sourcedir%%files1%" /b /s /a-d') do (
if %%a==%files1% Exist (
if not exist "%destdir1%%Date%\ES\A" md "%destdir1%%Date%\ES\A"
if not exist "%destdir2%%Date%\ES\A" md "%destdir2%%Date%\ES\A"
if not exist "%sourcedir_arh%%Date%\ES\A" md "%sourcedir_arh%%Date%\ES\A"
xcopy %%a %destdir1%%Date%\ES\A\ /H /Y /C /R /S /Z /EXCLUDE:d:\Rabota\GNI_test\listnotcopy.txt
xcopy %%a %destdir2%%Date%\ES\A\ /H /Y /C /R /S /Z /EXCLUDE:d:\Rabota\GNI_test\listnotcopy.txt >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt )
move %sourcedir1%%files1% "%sourcedir_arh%"%Date%\ES\A\ >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt
) else (
for /f "tokens=1-3*" %%b in ('dir "%sourcedir%%files2%" /b /s /a-d') do (
if %%b==%files2% Exist (
if not exist "%destdir1%%Date%\ES\AN" md "%destdir1%%Date%\ES\AN"
if not exist "%destdir2%%Date%\ES\AN" md "%destdir2%%Date%\ES\AN"
if not exist "%sourcedir_arh%%Date%\ES\AN" md "%sourcedir_arh%%Date%\ES\AN"
xcopy %%b %destdir1%%Date%\ES\AN\ /H /Y /C /R /S /Z /EXCLUDE:d:\Rabota\GNI_test\listnotcopy.txt
xcopy %%b %destdir2%%Date%\ES\AN\ /H /Y /C /R /S /Z /EXCLUDE:d:\Rabota\GNI_test\listnotcopy.txt >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt )
move %sourcedir2%%files2% "%sourcedir_arh%"%Date%\ES\AN\ >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt
) else (
for /f "tokens=1-3*" %%c in ('dir "%sourcedir%%files3%" /b /s /a-d') do (
if %%c==%files3% Exist (
if not exist "%destdir1%%Date%\ES\BN" md "%destdir1%%Date%\ES\BN"
if not exist "%destdir2%%Date%\ES\BN" md "%destdir2%%Date%\ES\BN"
if not exist "%sourcedir_arh%%Date%\ES\BN" md "%sourcedir_arh%%Date%\ES\BN"
xcopy %%c %destdir1%%Date%\ES\BN\ /H /Y /C /R /S /Z /EXCLUDE:d:\Rabota\GNI_test\listnotcopy.txt
xcopy %%c %destdir2%%Date%\ES\BN\ /H /Y /C /R /S /Z /EXCLUDE:d:\Rabota\GNI_test\listnotcopy.txt >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt )
move %sourcedir3%%files3% "%sourcedir_arh%"%Date%\ES\BN\ >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt
)
if not exist "%destdir1%%Date%\TF" md "%destdir1%%Date%\TF" >> %log%log_%date%.txt
Date /t >> %log%log_%date%.txt
Time /t >> %log%log_%date%.txt