第1个回答 2018-06-21
把下面的批处理存为mymove.bat,注意要改一下您的目录位置dest=和src=,为了好处理,我把您的eml文件先拷贝了一遍,然后再往1、2、3……文件夹中移动。这个程序已经在Win10下测试通过了。
@echo off
@setlocal enabledelayedexpansion
@set dest=d:\eml
@set src=c:\eml
@copy %src%\*.eml %dest%\
@set dir=0
@if not exist %dest%\. md eml
:D
@dir %dest%\*.eml>nul
@if %errorlevel%==1 goto X
@set /a dir=dir+1
@md %dest%\%dir%
@set f=0
@md %dest%\%dir%
@for /f "delims=" %%i in ('dir /b %dest%\^*.eml') do (
@move "%dest%\%%i" %dest%\%dir%
@set /a f=f+1
@if !f!==1500 goto D
)
:X
您试试看