NaturalJ0 兄的代码挺不错的,只是要生成临时文件,有点不爽。我来一段代码,这个代码要放在old文件夹下,如果有特殊要求,请修改copy里的参数:
@echo off
if not exist ..\new md ..\new
setlocal enabledelayedexpansion
for /l %%i in (1,1,99) do (
for /f "delims=" %%j in ('dir /a-d /b /s %%i') do (
set /a num+=1
set name=00!num!
copy "%%j" ..\new\!name:~-3!%%~xj>nul
)
)
start ..\new
Last edited by namejm on 2006-11-17 at 08:08 PM ]