本帖最后由 erjnasrtnws 于 2016-1-9 13:41 编辑
回复 27# ygqiang - @echo off
- set "s=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
- for /f "tokens=2*" %%i in ('reg query "%s%" /v Desktop') do (
- set "Desktop=%%j"
- )
- for /f %%i in ('wmic os get LocalDateTime^|findstr /b [0-9]') do (
- set "Today=%%i"
- )
-
- set "Today=%Today:~0,8%"
- md "%Desktop%\归档\%Today%\" 2>nul
-
- set "MyPath=%Desktop:~2%\"
- set wql=where "drive='%Desktop:~0,2%' and path='%MyPath:\=\\%' and extension!='LNK'"
- for /f "tokens=1*" %%i in ('wmic datafile %wql% get creationdate^,name^|findstr /b %Today%')do (
- for /f "delims=" %%j in ("%%j") do (
- if /i not "%%~fj" == "%~f0" move "%%~fj" "%Desktop%\归档\%Today%\"
- )
- )
- pause
复制代码 我现在就用的这个 感觉横好 不需要EXE的
你可以试试 只处理桌面上的今天产生的文件 在桌面上已日期归档 (是移动文件不是复制) |