- @echo off
- cd /d "%~dp0"
- @REM 把当前目录下 创建日期是今天的文件和文件夹移动到 今天'yyyy-MM-dd'文件夹
- set "batchfile=%~f0"
- powershell -c "$today=[datetime]::Today;$di=[io.directory]::CreateDirectory($today.ToString('yyyy-MM-dd'));gci|where{$_.CreationTime.Date -eq $today -and $_.FullName -ne $di.FullName -and $_.FullName -ne $env:batchfile}|Move-Item -Destination ($di.FullName) -Verbose"
- pause
复制代码
|