@echo off
REM
chcp 65001
CLS
echo 删除旧hash...
cd.>hash.txt
echo 正在生成图片名列表...
setlocal enabledelayedexpansion
for /r %%i in (*.png) do (
set s=%%i
set s=!s:%~dp0=!
echo !s!>> list2.txt
)
echo 正在生成hash列表...
setlocal enabledelayedexpansion
for /f "delims=" %%i in (list2.txt) do (
set s=%%i
set s=!s:~-28,24!
echo !s%!>>list1.txt
)
@echo 正在合并...请稍等...
@echo delims属于正常情况
set num=0
setlocal enabledelayedexpansion
for /f "delims=" %%a in (list1.txt) do (
if !num! equ 0 (
set /p str=<list2.txt
@echo %%~a = !str!>>list3.txt
) else (
call:get !num! "%%~a"
)
set /a num+=1
)>nul 2>nul
:get
for /f "skip=%~1 delims=" %%b in (list2.txt) do (
@echo %~2 = %%b>>list3.txt
goto :eof
)>nul 2>nul
@echo 正在标准化格式...
setlocal enabledelayedexpansion
for /f "delims=" %%f in (list3.txt)do (
echo %%f >nul 2>nul
set "f=%%f"
set "f=!f:\=/!"
set "f=!f: = !"
echo !f!>>hash.txt
)
@echo 删除临时文件...
del list1.txt
del list2.txt
del list3.txt
@echo 完成!
TIMEOUT /T 5
exit