In Windows 2000, for the code:
First, for the part of handling `FileDate`:
The original code for setting `FileDate` in Windows 2000:
```
set FileDate=08-10-22 17:56
set FileDate=!FileDate:-=!
set FileDate=!FileDate:~0,8!
if !FileDate! LSS 20081023 (echo ....)
```
Since in Windows 2000, the way of handling date format might have some differences, but the basic operations of replacing `-` and taking the first 8 characters are similar. Just make sure the date comparison is correct according to the actual situation.
For the part related to `MyDel.vbs`:
The code for creating and running the VBScript is the same in terms of logic. It calculates the date minus 11 days and then gets the formatted date string.
For the part of getting the file date and comparing:
The line `set FileDate=%%~ta` gets the file date and time. In Windows 2000, the format of `%%~ta` might be a bit different from XP and 2003, but the subsequent operations of replacing `-` and taking the first 8 characters are the same. Then comparing `!FileDate!` with `%DateFlag%` is the same logic.
The overall translated code remains as the original code structure but adjusted for the Windows 2000 environment considerations as described above.
The translated text of the entire code block as follows:
In win2003 it works normally to delete
set FileDate=2008-10-27 22:20
set FileDate=!FileDate:-=!
set FileDate=!FileDate:~0,8!
if !FileDate! LSS 20081018 (echo ....)
How to modify this code under win2000?
set FileDate=08-10-22 17:56
set FileDate=!FileDate:-=!
set FileDate=!FileDate:~0,8!
if !FileDate! LSS 20081023 (echo ....)
set desfolder=e:\rardata
setlocal enabledelayedexpansion
>"%tmp%\MyDel.vbs" echo dt=date()-11
>>"%tmp%\MyDel.vbs" echo s=right(year(dt),4) ^& right("0" ^&
month(dt),2) ^& right("0" ^& day(dt),2)
>>"%tmp%\MyDel.vbs" echo wscript.echo s
for /f %%a in ('cscript /nologo "%tmp%\MyDel.vbs"') do set DateFlag=%%a
echo %DateFlag%
pause
for /f "tokens=*" %%a in ('dir /s /b /a-d "%desfolder%"') do (
set FileDate=%%~ta The file date obtained here is different from that in xp and 2003.
set FileDate=!FileDate:-=!
set FileDate=!FileDate:~0,8!
if !FileDate! lss %DateFlag% (
echo "%%a"
)
)
pause