本帖最后由 /zhqsystem/zhq 于 2016-11-26 02:22 编辑
- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('"dir/ad/s/b/l/og "%~dp0*.*""')do (
- for /f "delims=" %%j in ("%%~fi\..")do (
- for %%n in (a,b,c,d)do (
- if "%%~fi"=="%%~fj\%%n" (
- if exist "%%~dpj合并数据\%%~n\" md "%%~dpj合并数据\%%~n\"
- if not exist "%%~dpj合并数据\%%~n\自动重命名%%~nxj_%%~nxi" (
- for /f "delims=" %%c in ('dir/a-d/b "%%~fi\*.*"')do (
- echo,f|xcopy "%%~fi\%%~nxc" "%%~dpj合并数据\%%~n\自动重命名%%~nxj_%%~nxi_%%~nxc"
- (echo,"%%~dpj合并数据\%%~n\自动重命名%%~nxj_%%~nxi_%%~nxc" "%%~fi\%%~nxc")>>"%~dp0数据记录用于返回原来结构.txt"
- )
- )
- )
- )
- )
- )
- )
- pause
复制代码
|