批量移动子目录文件到当前目录

    @echo off
    echo 移动文件中...
    for /f "delims=" %%i in ('dir *.* /a-d /s /b') do (
    if not "%%~dpi"=="%~dp0" call :movefile "%%i"
    )
    echo 移动文件完成!
    pause&exit
    :movefile
    if exist "%~dp0%~nx1" set "n="&goto renfile
    move %1 "%~dp0">nul 2>nul||(attrib -r -h -s %1& move %1 "%~dp0">nul)
    goto :eof
    :renfile
    set/a n+=1
    if exist "%~dp0%~n1(%n%)%~x1" goto renfile
    move %1 "%~dp0%~n1(%n%)%~x1">nul 2>nul||(
    attrib -r -h -s %1& move %1 "%~dp0%~n1(%n%)%~x1">nul)
    goto :eof

    转载请注明:RAIN MAN » 批量移动子目录文件到当前目录

    喜欢 0
标签:

还没有人抢沙发呢~