- <# :
- @echo off
- rem 增强代码兼容性,代码保存为 ".bat"、".cmd"、".ps1"均可执行
- powershell Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
- more +8 "%~f0" >"%~dpn0.ps1"
- powershell -File "%~dpn0.ps1"
- del "%~dpn0.ps1" & pause & exit /b
- #>
- $folder = 0
- md $folder
- dir *.jpg | foreach {
- $mb += $_.Length
- if ($mb -le 970mb) {
- move $_ $folder
- } else {
- move $_ $folder
- $folder += 1
- $mb = 0
- md $folder
- }
-
- }
复制代码
|