放在e:\根目录执行,查看执行结果是否正确,正确后明滑禅删除第8行的echo后再执行一遍。
@echo off&setlocal enabledelayedexpansion
for /f "delims=U"激尘 %%a in ('cmd /u /c echo 唉') do set "tab=%%a"
cd /d "E:\学籍照片"
(for /f "delims=" %%a in ('echo ##^&dir /b/od') do (
set/p fn=
if not "%%a"=="##" (
for /f "tokens=2 delims=%tab%" %%b in ("!fn!") do (
让或 echo ren "%%a" "%%b"
)
)
))<"e:\学生基本信息表.txt"
pause
setlocal enabledelayedexpansion
pushd e:\学籍照片弯羡拦
for /f "tokens=*" %%i in (学生基本埋胡信息表.txt) do (
set /a n+=1
set #!n!=%%i)
set n=
(for /f "tokens=*" %%i in ('dir/b/od *.jpg') do (
set /a n+=1
call set fn=%%#!n!%%
echo ren "%%i" "!fn!.jpg"))>dd.bat
运行批派段处理生成dd.bat在e:\学籍照片,核对无误后运行即可。