本帖最后由 happy886rr 于 2016-4-21 14:12 编辑
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('type test.txt') do (set /a i+=1 &set "#!i!=%%a")
- set i=0
- CD "%~dp0folder"
- for /f "delims=" %%a in ('dir /a-d /s /b') do (
- set /a i+=1
- for %%i in (!i!) do (
- if exist "!#%%i!%%~xa" (
- set k=1
- for /l %%j in (1 1 32) do (
- if !k! equ 1 (
- if not exist "!#%%i!(%%j)%%~xa" (
- rename "%%a" "!#%%i!(%%j)%%~xa"
- set k=0
- )
- )
- )
- ) else (
- rename "%%a" "!#%%i!%%~xa"
- )
- )
- )
- pause>nul
复制代码 回复 5# qixiaobin0715 |