@echo off
:Init
Title 修改资源_SogouPY
MODE con: Cols=45 Lines=12
Color 2f

:BatchGotAdmin
:--------------------------------------
Set "_Args=%* "
if `%1` neq `` Set "_Args=%_Args:"=""%"
fltmc 1>nul 2>nul||mshta VBScript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c """"%~f0"" %_Args%""",,"runas",1)(Window.Close) 2>nul&&Exit /b
Pushd "%CD%"&cd /d "%~dp0"
:--------------------------------------

:Begin
Call :ModRes ..\SogouPY.ime SogouPY.ime "-delete DIALOG,129,2052"
Call :ModRes ..\SogouPY64.ime SogouPY64.ime "-delete DIALOG,129,2052"
Call :ModRes ..\SogouPY.ime SogouPY.ime "-delete DIALOG,66,2052"
Call :ModRes ..\SogouPY64.ime SogouPY64.ime "-delete DIALOG,66,2052"
Goto End

:ModRes
echo 正在修改 %1 文件
Set ResCmd=%3
Set ResCmd=%ResCmd:"=%
(echo [FILENAMES]
 echo Exe=    %1
 echo SaveAs= %2
 echo.
 echo [COMMANDS]
 echo %ResCmd%) >ResHacker.txt
if not exist ResHacker.txt Call :Delay 1
start /wait ResHacker.exe -script ResHacker.txt
del /q ResHacker.txt 1>nul 2>nul
del /q ResHacker.log 1>nul 2>nul
del /q ResHacker.ini 1>nul 2>nul
Goto :eof

:End
echo.
Call :Xecho "5e.:修改完成！！"
Call :Delay 2 +
Exit /b

:Delay
REM 延迟操作，参数1：延迟秒数，参数2：+为显示倒计时
if `%2` == `+` (Set n=2) else Set n=1
if exist %WINDIR%\System32\timeout.exe (timeout /t %1 %n%>nul) else if exist %WINDIR%\System32\choice.exe (choice /t %1 /d y /n >nul) else ping 127.1 -n %1 >nul
Goto :eof

:Xecho
REM 显示彩色文字，不支持半角字符 \ / : * ? " < > | . % ! ~
setlocal enabledelayedexpansion
Set echox=EchoX.exe&&!echox! 1>nul 2>nul||Set echox=
for %%a in (%*) do (
    Set "param=%%a"&Set "param=!param:"=!"
    Set n=0&(if "!param:~2,2!" == "::" Set /a n+=1)&(if "!param:~2,2!" == ".:" Set /a n+=1)
    if !n! gtr 0 (
        if /i "!param:~0,2!" == "xx" (Set /p="_!param:~4!"<nul) else (Set param=%%~nxa&if defined echox (!echox! -c !param:~0,2! -n "!param:~4!") else (Pushd "%TEMP%"&>"!param:~4!",Set /p= <nul&findstr /a:!param:~0,2! .* "!param:~4!*"&del "!param:~4!"&Popd))
        if "!param:~2,1!" == "." echo.
    ) else if defined param Set /p="_!param!"<nul
)
endlocal
Goto :eof