Initial commit - Delphi MES client project

This commit is contained in:
Developer
2026-05-07 20:25:34 +08:00
commit 819b4824f6
466 changed files with 1176403 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
@echo off
chcp 65001 >nul
echo PAS文件ANSI转UTF-8批量转换工具 (修复版)
echo ===============================
set "source_dir=D:\word\client-dyp\pas"
if not exist "%source_dir%" (
echo 错误:目录 "%source_dir%" 不存在
pause
exit /b 1
)
echo 正在处理目录: %source_dir%
echo.
for /f "tokens=1-3 delims=/: " %%a in ('echo %date% %time%') do (
set "backup_dir=%source_dir%\backup_%%a%%b%%c_%time:~0,2%%time:~3,2%"
)
set "backup_dir=%backup_dir: =%"
if not exist "%backup_dir%" mkdir "%backup_dir%"
set /a total=0
set /a converted=0
set /a failed=0
for /r "%source_dir%" %%f in (*.pas) do (
set /a total+=1
echo [!total!] 处理文件: %%~nxf
copy "%%f" "%backup_dir%\%%~nxf" >nul 2>&1
powershell -Command "try { $content = Get-Content '%%f' -Encoding Default; [System.IO.File]::WriteAllText('%%f', $content, [System.Text.Encoding]::UTF8); exit 0 } catch { exit 1 }"
if !errorlevel! equ 0 (
echo 状态: 成功
set /a converted+=1
) else (
echo 状态: 失败 - 已恢复备份
copy "%backup_dir%\%%~nxf" "%%f" >nul 2>&1
set /a failed+=1
)
echo.
)
echo ===============================
echo 转换完成!
echo 总文件数: %total%
echo 成功转换: %converted% 个文件
echo 转换失败: %failed% 个文件
echo 备份位置: %backup_dir%
echo ===============================
if %failed% gtr 0 (
echo.
echo 注意:有 %failed% 个文件转换失败,已从备份恢复。
)
pause