- @echo off
- regedit /e "%temp%\bak.reg" "HKEY_CURRENT_USER\Control Panel\International"
- ::::备份系统原时间日期格式
- >aDate.reg echo REGEDIT4
- >>aDate.reg echo.
- >>aDate.reg echo [HKEY_CURRENT_USER\Control Panel\International]
- >>aDate.reg echo "sShortDate"="yyyy-MM-dd"
- >>aDate.reg echo "sDate"="-"
- >>aDate.reg echo "sTimeFormat"="HH:mm:ss"
- regedit /s aDate.reg&del aDate.reg
- ::::统一格式化系统日期格式(无需reg.exe兼容Win2000)
-
- >tmp.vbs echo Wscript.echo FormatDateTime (DateAdd("d", -3 ,Date),2)
- for /f "delims=" %%i in ('cscript.exe //nologo tmp.vbs') do set aDate=%%i& del tmp.vbs
- ::::用VBS计算当前日期减 3 天,如果要当前之后的 3 天请将 ↑上面 2 行的 -3 改成 +3
-
- echo %aDate%
- set 年=%aDate:~0,4%
- set 月=%aDate:~5,2%
- set 日=%aDate:~8,2%
- set 3天前=%年%%月%%日%
- setlocal enabledelayedexpansion
- Wmic Datafile Where "Drive='D:' and path='\\111\\' and CreationDate<'!3天前!000000.000000+***'" call delete /NOINTERACTIVE
- regedit /s "%temp%\bak.reg"&del "%temp%\bak.reg"
- ::::还原系统原时间日期格式
- pause
复制代码
[ 本帖最后由 fastslz 于 2008-8-5 20:57 编辑 ] |