自己研究出來了!這個運行兩天了,還沒有出現問題.不過覺得不夠精減.還請大家提點意見和改進方案.
@echo off
date /t |find "星期一"
if errorlevel 1 goto NoFind1
if errorlevel 0 goto Find1
:NoFind1
date /t |find "星期二"
if errorlevel 1 goto NoFind2
if errorlevel 0 goto Find2
:Find1
rd k:\bostonbak\2 /s /q
md k:\bostonbak\2
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\1\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
goto End
:NoFind2
date /t |find "星期三"
if errorlevel 1 goto NoFind3
if errorlevel 0 goto Find3
:Find2
rd k:\bostonbak\3 /s /q
md k:\bostonbak\3
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\2\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
goto End
:NoFind3
date /t |find "星期四"
if errorlevel 1 goto NoFind4
if errorlevel 0 goto Find4
:Find3
rd k:\bostonbak\4 /s /q
md k:\bostonbak\4
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\3\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
goto End
:NoFind4
date /t |find "星期五"
if errorlevel 1 goto NoFind5
if errorlevel 0 goto Find5
:Find4
rd k:\bostonbak\5 /s /q
md k:\bostonbak\5
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\4\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
goto End
:NoFind5
date /t |find "星期六"
if errorlevel 1 goto NoFind6
if errorlevel 0 goto Find6
:Find5
rd k:\bostonbak\6 /s /q
md k:\bostonbak\6
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\5\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
goto End
:NoFind6
rd k:\bostonbak\1 /s /q
md k:\bostonbak\1
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\7\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
goto End
:Find6
rd k:\bostonbak\7 /s /q
md k:\bostonbak\7
xcopy J:\boston\data\PAPERSYSTEMFT.IB K:\bostonbak\6\"%date:~8,2%%time:~0,2%%time:~3,2%"\ /y
:End