按修改时间整理,贴在这里备份,不太实用,不了解代码的慎用。- @echo off&chcp 936
- for /f "delims=" %%a in ('dir/a/b')do if /i not "%%~xa"==".bat" (
- set "nxa=%%~nxa"
- setlocal enabledelayedexpansion
- if "!nxa:~4,1!!nxa:~7,1!" neq "--" endlocal&(
- if not "%%~nxa"=="%~nx0" (
- if not "%%~ta" == "%date:~0,10%" (
- set dt=%%~ta
- set "File=%%a"
- set "fn=%%~na"
- set "fx=%%~xa"
- setlocal enabledelayedexpansion
- set dt=!dt:~0,10!
- if not exist !dt! md !dt!
- if exist "!dt!\!file!" ren "!file!" "!fn!_!time:~-5!"
- move "!file!" !dt!\||echo error: !file!
- title !dt!\ !file!
- endlocal
- )
- )
- )else endlocal
- )
- pause
复制代码
|