我也简化一下 install 段- @echo off
- set "RarPath=C:\Program Files\WinRAR\WinRAR.exe"
- :install
- for /f "delims=" %%I in ('dir /b/s/on "%~dp0*.rar"') do (
- del "%tmp%\ALI213*.txt" >nul 2>nul
- "%RarPath%" x -y -ibck "%%I" *.txt *.man *.pak *.bin "%%~dpnI\PAKS\"
- PUSHD "%%~dpnI\PAKS\"
- If exist "ALI213.txt" (
- rem 这里的+20自己去调整
- more /s +20 "%~s0" > "U82A.vbs"
- U82A.vbs "ALI213.txt" "ALI213.txt.ansi.t"&del U82A.vbs
- >"%%~nI_说明.txt.ansi.t" more +60 "ALI213.txt.ansi.t"
- del "ALI213.txt" "ALI213.txt.ansi.t"
- )
- type *.txt >>"%%~nI_说明.txt.ansi.t" 2>nul
- move "%%~nI_说明.txt.ansi.t" "%%~nI_说明.txt"
- popd
- )
- PAUSE&goto :eof
-
-
-
-
-
- Set objArgs = WScript.Arguments
- FUS = objArgs(0)
- FUD = objArgs(1)
- Call WriteToFile(FUD, ReadFile(FUS, "UTF-8"), "gbk")
-
- Function ReadFile(FUS, CharSet)
- Dim Str
- Set ADOStrm = CreateObject("Adodb.Stream")
- ADOStrm.Type = 2
- ADOStrm.mode = 3
- ADOStrm.charset = CharSet
- ADOStrm.Open
- ADOStrm.loadfromfile FUS
- S = ADOStrm.readtext
- ADOStrm.Close
- Set ADOStrm = Nothing
- ReadFile = S
- End Function
-
- Function WriteToFile (FUD, S, CharSet)
- Set ADOStrm = CreateObject("Adodb.Stream")
- ADOStrm.Type = 2
- ADOStrm.mode = 3
- ADOStrm.charset = CharSet
- ADOStrm.Open
- ADOStrm.WriteText S
- ADOStrm.SaveToFile FUD, 2
- ADOStrm.flush
- ADOStrm.Close
- Set ADOStrm = Nothing
- End Function
复制代码
|