Okay... it comprises of two batch files (Three, if you include the one created in the temporary directory by the first)
Code:
@echo Off
if %1.==. goto NoInput
set TFL=%temp%\FileList.cmd
set sd=%~dp0
set ScriptDir=%~d0:%~p0
set OWD=%CD%
cd /D %1
echo --==[ * Translating PT Client in %1 * ]==--
echo --==[ Preparing to translate ]==--
zip -9mDXq %Temp%\PTBackup.zip *
echo --[ Generating temporary file list ]--
echo @echo off>%TFL%
dir /A-D/s/b>>%TFL%
echo [EOF]>>%TFL%
gsar -o -s":x0d:x0a[EOF]:x0d:x0a" -r":x22" %TFL%>Nul:
gsar -o -s"%~d1:%~pn1\\" -r"" %TFL%>Nul:
gsar -o -s":x0d:x0a" -r":x22:x0d:x0acall :x22%ScriptDir%Translate:x22 :x22" %TFL%>Nul:
gsar -o -s"echo off:x22" -r"echo off" %TFL%>Nul:
echo --[ Processing Files ]--
call %TFL%
goto CleanUp
:NoInput
echo --==[ GIGO Error: NO INPUT DIRECTORY ]==--
goto End
:CleanUp
echo --==[ Cleaning up ]==--
pause to debug temporary files
unzip -oq %Temp%\PTBackup -d %1
del %Temp%\PTBackup.zip
del %Temp%\FileList.bat
:End
echo --==[ Operation Complete ]==--
cd /D %OWD%
pause
Which generates a 2nd in a temporary directory from a manipulated directory listing of the present working directory, and then calls that.
That then calls back to the last one where the translations are actually stored:-
Code:
@echo off
rem "// 캐릭터 주인공 설정값" to "// Character hero settings"
gsar -o -s"// 캐릭터 주인공 설정값" -r"// Character hero settings" %1
rem "*모양파일" comment as "// Shape file"
gsar -o -s":x0d:x0a*모양파일" -r":x0d:x0a// Shape file:x0d:x0a*모양파일" %1
rem "*정밀모양" comment as "// High detail"
gsar -o -s":x0d:x0a*정밀모양" -r":x0d:x0a// High detail:x0d:x0a*정밀모양" %1
rem "*보통모양" comment as "// Normal detail"
gsar -o -s":x0d:x0a*보통모양" -r":x0d:x0a// Normal detail:x0d:x0a*보통모양" %1
rem "*저질모양" comment as "// Low detail"
gsar -o -s":x0d:x0a*저질모양" -r":x0d:x0a// Low detail:x0d:x0a*저질모양" %1
rem "*파일연결" comment as "// Shape link"
gsar -o -s":x0d:x0a*파일연결" -r":x0d:x0a// Shape link:x0d:x0a*파일연결" %1
THIS FILE MUST BE CALLED Translate.bat or Translate.cmd AND RESIDE IN THE SAME FOLDER AS THE FIRST.
Now... a couple of points, because that probably all looks like nonsense to most people.
1) These principals work great in bash scripts, and I picked up the recursion tactics on the Amiga OS... In Microsoft Batch / NT Command scripts, it doesn't work so well, because you can't include subroutines, or even a reverse GOTO. gsar (gnu search and replace) is a pretty good substitute for most unix heads love of grep, and more convenient for this task.
2) This relies on those nasty %~ variables that (as I have mentioned elsewhere) I don't really like because Microsoft don't (or didn't last time I looked) officially acknowledge their existence. They are, then, an undocumented feature that poped up around Windows NT 4.
%CD% is like $PWD in unix IMS.
To make them work, you need
To view the content, you need to sign in or register
clearly for the search and replace functionality which resides at the core of at least two of the 3 batch files. You also need
To view the content, you need to sign in or register
if you want it to create the backup without throwing an error on that line.
It's been over a year since I started this and then stopped... I don't remember why, and clearly there are many more translations I should have added for it to be complete... still the source may be of use as a quick starting point.
Enjoy.
Edit----
Actually, hunting around, I think there are many more features added to the NT shell scripts which are poorly documented by MS but are documented elsewhere. Specifically, it seems you can now "CALL" a subroutine within a batch file. I used to use 4DOS before we all went NT (Server and workstation) because it fixed many of these issues, but it seems MS may have gotten around to it and forgotten to tell us.
These scripts already also use >> appended output redirection with (usually) didn't work on DOS largely because there was no support for true fifos and pipes. NT4 + has that capability and NT5 is very nearly POSIX compliant in many core respects.