iT邦幫忙

1

DOSBOX自動執行.BAT.---選單無法自動抓繁體中文檔案名稱.

  • 分享至 

  • xImage

DOSBOXGAME(CHT-ENG).bat


@echo off
setlocal EnableDelayedExpansion
mode con cols=80 lines=25
for /F "tokens=3" %%a in ('reg query HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Language /v default ^|find /i "default"') do set cLang=%%a
::
:MENU
if "%cLang%"=="0404" (goto MENU_T) else GOTO MENU_S
::
::
::
:MENU_T
CLS
COLOR 0A
ECHO.
ECHO.
ECHO. =-=-=-=-=請選擇游戲類別=-=-=-=-=
ECHO.
ECHO.
ECHO. 1 角色扮演類 2 戰棋類
ECHO.
ECHO. 3 (回合)策略類 4 即時戰略類
ECHO.
ECHO. 5 動作射擊類 6 模擬養成/經營類
ECHO.
ECHO. 7 休閒益智類 8 冒險解迷類
ECHO.
ECHO.
ECHO. X 退出 H 幫助說明
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
CHOICE /C 123456789xh /N /M 請輸入選擇項目的序號:
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 set LOGOT=   角色扮演類游戲   & set "GAME=RPG" & GOTO submenu
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 set LOGOT=    戰棋類游戲    & set "GAME=SPG" & GOTO submenu
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 set LOGOT=   (回合)策略類   & set "GAME=SLG" & GOTO submenu
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 set LOGOT=   即時戰略類游戲   & set "GAME=RTS" & GOTO submenu
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 set LOGOT=   動作射擊類游戲   & set "GAME=ACT" & GOTO submenu
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 set LOGOT=   模擬養成/經營類   & set "GAME=SIM" & GOTO submenu
IF ERRORLEVEL 7 IF NOT ERRORLEVEL 8 set LOGOT=   休閒益智類游戲   & set "GAME=PUZ" & GOTO submenu
IF ERRORLEVEL 8 IF NOT ERRORLEVEL 9 set LOGOT=   冒險解迷類游戲   & set "GAME=AVG" & GOTO submenu
IF ERRORLEVEL 9 IF NOT ERRORLEVEL 10 set LOGOT=   H類/文字冒險類   & set "GAME=HGA" & GOTO question_t
IF ERRORLEVEL 10 IF NOT ERRORLEVEL 11 GOTO END
IF ERRORLEVEL 11 IF NOT ERRORLEVEL 12 if exist readme_t.txt (cls&type readme_t.txt|more&&pause) else (cls&echo.&echo. 無法找到幫助文件&echo.&pause)
goto MENU_T
::
::
::
:MENU_S
CLS
COLOR 0A
ECHO.
ECHO.
ECHO. =-=-=-=-=恁寁蚔牁濬梗=-=-=-=-=
ECHO.
ECHO.
ECHO. 1 褒伎啁栳濬 2 桵濬
ECHO.
ECHO. 3 (隙磁)習謹濬 4 撈奀桵謹濬
ECHO.
ECHO. 5 雄釬扞僻濬 6 耀攜欱傖/冪茠濬
ECHO.
ECHO. 7 倎玿祔秷濬 8 簸玸賤譎濬
ECHO.
ECHO.
ECHO. X 豖堤 H 堆翑佽隴
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
CHOICE /C 123456789xh /N /M 怀恁寁砐醴腔唗瘍ㄩ
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 set LOGOT=﹛﹛﹛褒伎啁栳濬蚔牁﹛﹛﹛& set "GAME=RPG" & GOTO submenu
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 set LOGOT=﹛﹛﹛﹛桵濬蚔牁﹛﹛﹛﹛& set "GAME=SPG" & GOTO submenu
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 set LOGOT=﹛﹛﹛ㄗ隙磁ㄘ習謹濬﹛﹛﹛& set "GAME=SLG" & GOTO submenu
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 set LOGOT=﹛﹛﹛撈奀桵謹濬蚔牁﹛﹛﹛& set "GAME=RTS" & GOTO submenu
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 set LOGOT=﹛﹛﹛雄釬扞僻濬蚔牁﹛﹛﹛& set "GAME=ACT" & GOTO submenu
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 set LOGOT=﹛﹛ 耀攜欱傖ㄞ冪茠濬 ﹛﹛& set "GAME=SIM" & GOTO submenu
IF ERRORLEVEL 7 IF NOT ERRORLEVEL 8 set LOGOT=﹛﹛﹛倎玿祔秷濬蚔牁﹛﹛﹛& set "GAME=PUZ" & GOTO submenu
IF ERRORLEVEL 8 IF NOT ERRORLEVEL 9 set LOGOT=﹛﹛﹛簸玸賤譎濬蚔牁﹛﹛﹛& set "GAME=AVG" & GOTO submenu
IF ERRORLEVEL 9 IF NOT ERRORLEVEL 10 set LOGOT=﹛﹛ H濬ㄞ恅趼簸玸濬﹛﹛﹛& set "GAME=HGA" & GOTO question
IF ERRORLEVEL 10 IF NOT ERRORLEVEL 11 GOTO END
IF ERRORLEVEL 11 IF NOT ERRORLEVEL 12 if exist readme.txt (cls&type readme.txt|more&&pause) else (cls&echo.&echo. 拸楊梑善堆翑恅璃&echo.&pause)
goto MENU
::
::
::
:submenu
if /i "%GAME:~-1,1%"=="A" if not defined Agetime (goto menu)
cls
CALL :LOGO
ECHO #>GAME.LST
set GmNumb=
if "%cLang%"=="0404" (set gamelist=gamelist.csv) else (set gamelist=gamelist.csv)
for /F "EOL=# delims=" %%a in ('findstr /i "%game%" %gamelist%') do (
set "strg=%%a"
for /F "tokens=3 delims=," %%b in ("!strg!") do (
if exist %%b (
set /a GmNumb+=1
ECHO !strg!>>GAME.LST
)))
set GmNumbRemain=%GmNumb%
set JumpNumbAll=1
SET JumpNumbTmp=1
set PgNumb=1
set GmNumb_0=0
set GmNumb_1=0
set RowNumb=1
SET GmNumbAtRow=4
set GmNO=A B C D E F G H I J K L M N O P Q R S T
set cn=1
set CurABC=
SET GmName=
SET ShowRowGmName=
set CHOICA=
if "%cLang%"=="0404" (set "PgShow1=1 上一頁"&set "PgShow2=2 下一頁") else (
set "PgShow1=1 奻珨珜"&set "PgShow2=2 狟珨珜")
set "PgShow3= "
GOTO GmListEachRow
::
::
::
:GmListEachRow
for /F "skip=%JumpNumbAll% delims=, tokens=3" %%c in (game.lst) do (
set CurGmName=%%c
set Blanks=
echo !CurGmName!>TempName.txt
call :CaLenth TempName.txt
IF !CharLenth! LEQ 19 (set /a BlankNumb=20-!CharLenth!) ELSE (
IF !CharLenth! LEQ 37 (set /a BlankNumb=39-!CharLenth!)&(set /a GmNumbAtRow=!GmNumbAtRow!-1) ELSE GOTO ERROR1
)
IF !GmNumbAtRow! LEQ 0 GOTO ShowPageGmList
CALL :CalBlank !BlankNumb!
CALL :CHARN
SET ShowRowGmName=!ShowRowGmName!!CurABC! %%c!Blanks!
SET /a GmNumbAtRow=!GmNumbAtRow!-1
IF !GmNumbAtRow! LEQ 0 GOTO ShowPageGmList
)
GOTO :ShowPageGmList
::
::
::
:ShowPageGmList
ECHO.
ECHO %ShowRowGmName%
SET ShowRowGmName=
set /a GmNumbRemain=%GmNumbRemain%-%CN%+%JumpNumbTmp%
set /a JumpNumbTmp=%CN%-%JumpNumbTmp%
set /a GmNumbCurPg+=%JumpNumbTmp%
set /a JumpNumbAll+=%JumpNumbTmp%
SET /a JumpNumbTmp=%CN%
IF %GmNumbRemain% LEQ 0 (set NextPg=CURP&GOTO ChoiceCMD)
set GmNumbAtRow=4
IF %RowNumb% EQU 5 (set ProPg=PROP&set NextPg=NEXTP&GOTO ChoiceCMD)
SET /a RowNumb+=1
goto GmListEachRow
::
::
::
:NEXTP
CLS & CALL :LOGO
set ProPg=PROP
set JumpNumbAll=1
for /L %%a in (1,1,%PgNumb%) do call set /a JumpNumbAll+=%%GmNumb_%%a%%
set /a PgNumb+=1
set GmNumb_%PgNumb%=0
set CHOICA=
GOTO GmListEachRow
::
:PROP
CLS & CALL :LOGO
set /a PgNumb-=1
set /a ProPgNumb=%PgNumb%-1&set JumpNumbAll=1
for /L %%a in (0,1,%ProPgNumb%) do call set /a JumpNumbAll+=%%GmNumb_%%a%%
set /a GmNumbRemain=%GmNumb%-%JumpNumbAll%+1
set CHOICA=
GOTO GmListEachRow
::
:CURP
CLS & CALL :LOGO
set /a ProPgNumb=%PgNumb%-1&set JumpNumbAll=1
for /L %%a in (0,1,%ProPgNumb%) do call set /a JumpNumbAll+=%%GmNumb_%%a%%
set /a GmNumbRemain=%GmNumb%-%JumpNumbAll%+1
set CHOICA=
GOTO GmListEachRow
::
:CaLenth
set /a CharLenth=%~z1+1
goto :eof
::
:CalBlank
for /L %%i in (%1,-1,1) DO set "Blanks=!Blanks! "
goto :eof
::
:CHARN
for /F "tokens=%cn%" %%j in ("%GmNO%") DO set CurABC=%%j
set /a cn+=1
set CHOICA=%CHOICA%%CurABC%
goto :eof
::
:ERROR1
CLS
ECHO.&ECHO.
if "%cLang%"=="0404" (ECHO. 出錯啦!可能的原因為:&ECHO.&ECHO.
ECHO. 自行添加的文件夾名稱過長,或誤用了全角逗號“,”作為分隔符。 ) else (
ECHO. 堤渣徽ㄐ褫夔腔埻秪峈ㄩ&ECHO.&ECHO.
ECHO. 赻俴氝樓腔恅璃標靡備徹酗ㄛ麼昫蚚賸褒飯瘍※ㄛ§釬峈煦路睫﹝ )
ECHO.&ECHO.&ECHO.&ECHO.
PAUSE&COLOR&GOTO END
::
::
::
:LOGO
set colora=135
set colorb=8AE9EFABE
if /i "%GAME:~0,1%"=="R" (set colorx=0) else (
if /i "%GAME:~0,1%"=="A" (set colorx=0) else (
if /i "%GAME:~0,1%"=="H" (set colorx=2) else (set colorx=1)))
set /a colorN=%random%%%3+%colorx%*3
set colora=!colora:~%colorx%,1!
set colorb=!colorb:~%colorN%,1!
rem echo %colora%%colorb%
color %colora%%colorb%
if "%cLang%"=="0404" (
ECHO.
ECHO. ┌─────────────┐
ECHO. │%LOGOT%│
ECHO. └─────────────┘
) else (
ECHO.
ECHO. 庚岸岸岸岸岸岸岸岸岸岸岸岸岸庖
ECHO. 岫%LOGOT%岫
ECHO. 弩岸岸岸岸岸岸岸岸岸岸岸岸岸彼
)
GOTO :EOF
::
::
:ChoiceCMD
for /l %%a in (5,-1,%RowNumb%) do echo.&echo.
set RowNumb=1
SET JumpNumbTmp=1
SET CN=1
set GmNumbAtRow=4
set GmNumb_%PgNumb%=%GmNumbCurPg%
set GmNumbCurPg=0
if %PgNumb% EQU 1 (set ProPg=CURP)
if "%ProPg%"=="CURP" (set PageShow1=%PgShow3%) else (set PageShow1=%PgShow1%)
if "%NextPg%"=="CURP" (set PageShow2=%PgShow3%) else (set PageShow2=%PgShow2%)
if "%cLang%"=="0404" (ECHO. X 退出 0 返回主菜單 Page %PgNumb% %PageShow1% %PageShow2% ) else (
ECHO. X 豖堤 0 殿隙翋粕等 Page %PgNumb% %PageShow1% %PageShow2% )
ECHO.
ECHO.
ECHO.
if "%cLang%"=="0404" (CHOICE /C 120X%CHOICA% /N /M 請輸入選擇項目的序號: ) else (
CHOICE /C 120X%CHOICA% /N /M 怀恁寁砐醴腔唗瘍ㄩ )
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO %ProPg%
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO %NextPg%
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 GOTO MENU
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 GOTO END
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 set gmdir=0&GOTO rungame
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 set gmdir=1&GOTO rungame
IF ERRORLEVEL 7 IF NOT ERRORLEVEL 8 set gmdir=2&GOTO rungame
IF ERRORLEVEL 8 IF NOT ERRORLEVEL 9 set gmdir=3&GOTO rungame
IF ERRORLEVEL 9 IF NOT ERRORLEVEL 10 set gmdir=4&GOTO rungame
IF ERRORLEVEL 10 IF NOT ERRORLEVEL 11 set gmdir=5&GOTO rungame
IF ERRORLEVEL 11 IF NOT ERRORLEVEL 12 set gmdir=6&GOTO rungame
IF ERRORLEVEL 12 IF NOT ERRORLEVEL 13 set gmdir=7&GOTO rungame
IF ERRORLEVEL 13 IF NOT ERRORLEVEL 14 set gmdir=8&GOTO rungame
IF ERRORLEVEL 14 IF NOT ERRORLEVEL 15 set gmdir=9&GOTO rungame
IF ERRORLEVEL 15 IF NOT ERRORLEVEL 16 set gmdir=10&GOTO rungame
IF ERRORLEVEL 16 IF NOT ERRORLEVEL 17 set gmdir=11&GOTO rungame
IF ERRORLEVEL 17 IF NOT ERRORLEVEL 18 set gmdir=12&GOTO rungame
IF ERRORLEVEL 18 IF NOT ERRORLEVEL 19 set gmdir=13&GOTO rungame
IF ERRORLEVEL 19 IF NOT ERRORLEVEL 20 set gmdir=14&GOTO rungame
IF ERRORLEVEL 20 IF NOT ERRORLEVEL 21 set gmdir=15&GOTO rungame
IF ERRORLEVEL 21 IF NOT ERRORLEVEL 22 set gmdir=16&GOTO rungame
IF ERRORLEVEL 22 IF NOT ERRORLEVEL 23 set gmdir=17&GOTO rungame
IF ERRORLEVEL 23 IF NOT ERRORLEVEL 24 set gmdir=18&GOTO rungame
IF ERRORLEVEL 24 IF NOT ERRORLEVEL 25 set gmdir=19&GOTO rungame
pause
GOTO MENU
::
::
::
:Question
set EoInfo0=蛁砩ㄩ秪峈蜆笐紲粕等笢漪衄H濬蚔牁ㄛ垀眕硐衄傖符褫眕輛﹝
set EoInfo1=惕ㄛ斕腔爛鍵怮苤ㄛ祥巠磁輛H濬蚔牁﹝
set EoInfo2=毞徽ㄛ斕腔爛鍵怮橾賸﹝秪峈H濬蚔牁頗鍔徹衾倓煖ㄛ垀眕峈賸斕腔翩艙覂砑ㄛ扂砑扂祥蜆斕輛﹝
set EoInfo3=峈賸斕羶衄銑惆爛鍵ㄛ隙湘狟醱跺恀枙ㄩ
set EoInfo4=褫洇ㄛ斕軞僕湘渣賸
set EoInfo5=脹斕酗湮賸ㄛ麼逋劂棲隴賸婬懂勘ㄐ
set EoInfo6=峈賸痐隴斕硐岆囮昫ㄛ珋婓婬跤斕珨棒儂頗﹝隙湘狟醱謗耋蜇樓枙ㄩ
set EoInfo7=鳩炰ㄐ斕籵徹賸恀湘聆彸ㄛ狟醱憩輛H蚔牁粕等勘﹝﹝﹝﹝﹝﹝
cls
for /L %%a in (1,1,6) do echo.
echo %EoInfo0%&echo.&echo.
set /p Age= 怀斕腔爛鍵ㄩ
for /F "tokens=1,2 delims=:" %%a in ('time /t') do set AgeTime=%%a%%b
if "%Age%"=="%AgeTime%" goto QaPass
if %Age% LSS 18 echo.&echo. %EoInfo1%&echo.&echo.&pause&goto MENU_S
if %Age% GEQ 80 echo.&echo. %EoInfo2%&echo.&echo.&pause&goto MENU_S
if %Age% GEQ 18 if %Age% LSS 80 cls&echo.&call :showfont "%EoInfo3%"
set errorAw=0
for /L %%a in (1,1,3) do call :getQt %%a
if %errorAw% EQU 1 goto AddQt
if %errorAw% GEQ 2 (
echo.&echo.
echo. %EoInfo4%%errorAw%枙﹝
echo.&echo. %EoInfo5% ^^__^^
echo.&pause&goto MENU_S )
goto QaPass
::
:Question_t
set EoInfo0=注意:因為該隱藏菜單中含有H類游戲,所以只有成人才可以進入。
set EoInfo1=抱歉,你的年齡太小,不適合進入H類游戲。
set EoInfo2=天啦,你的年齡太老了。因為H類游戲會令人過于興奮,所以為了你的健康著想,我想我不該讓你進入。
set EoInfo3=為了確認你沒有謊報年齡,請回答下面三個問題:
set EoInfo4=可惜,你總共答錯了
set EoInfo5=等你長大了,或足夠聰明了再來吧!
set EoInfo6=為了證明你只是失誤,現在再給你一次機會。請回答下面兩道附加題:
set EoInfo7=恭喜!你通過了問答測試,下面就請進入H游戲菜單吧。。。。。。
cls
for /L %%a in (1,1,6) do echo.
echo %EoInfo0%&echo.&echo.
set /p Age= 請輸入你的年齡:
for /F "tokens=2,3 delims=: " %%a in ('time /t') do set AgeTime=%%a%%b
if "%Age%"=="%AgeTime%" goto QaPass
if %Age% LSS 18 echo.&echo. %EoInfo1%&echo.&echo.&pause&goto MENU_T
if %Age% GEQ 80 echo.&echo. %EoInfo2%&echo.&echo.&pause&goto MENU_T
if %Age% GEQ 18 if %Age% LSS 80 cls&echo.&call :showfont "%EoInfo3%"
set errorAw=0
for /L %%a in (1,1,3) do call :getQt_t %%a
if %errorAw% EQU 1 goto AddQt_t
if %errorAw% GEQ 2 (
echo.&echo.
echo. %EoInfo4%%errorAw%題。
echo.&echo. %EoInfo5% ^^__^^
echo.&pause&goto MENU_T )
goto QaPass

::
:showfont
set fnumb=0
set fontstr=%~1
:showfont1
set /p x="!fontstr:~%fnumb%,1!"<nul
call :yanshi1 10
set /a fnumb+=1
if not "!fontstr:~%fnumb%,1!"=="" goto showfont1
echo.
goto :eof
:yanshi1
for /F "tokens=3-4 delims=:." %%b in ("%time%") do set startime=%%b%%c
if %startime% LSS 1000 if %startime% GEQ 0100 (set startime=%startime:~1,3% )
if %startime% LSS 100 if %startime% GEQ 0010 (set startime=%startime:~2,2% )
if %startime% LSS 10 if %startime% GEQ 1 (set startime=%startime:~3,1% )
:yanshi2
for /F "tokens=3-4 delims=:." %%d in ("%time%") do set nowtime=%%d%%e
if %nowtime% LSS 1000 if %nowtime% GEQ 0100 (set nowtime=%nowtime:~1,3% )
if %nowtime% LSS 100 if %nowtime% GEQ 0010 (set nowtime=%nowtime:~2,2% )
if %nowtime% LSS 10 if %nowtime% GEQ 1 (set nowtime=%nowtime:~3,1% )
if %nowtime% LSS %startime% set /a nowtime+=6000
set /a diff=%nowtime%-%startime%
if %diff% LSS %1 goto yanshi2
goto :eof
::
:getQt
set Qline=0
for /L %%a in (1,1,5) do echo.
echo 菴%1枙 &echo.
set /a Qskip=%random%%%19*2+1+(%1-1)38
for /F "skip=%Qskip% tokens=1,2 delims=#" %%c in (qt.dat) do (
echo.
echo. %%c
set /a Qline+=1
if !Qline! EQU 2 (
echo.
echo.
set /p answer= 恁寁淏湘偶ㄩ
cls
if /i not "!answer!"=="%%d" set /a errorAw+=1
goto :eof ))
::
::
:getQt_t
set Qline=0
for /L %%a in (1,1,5) do echo.
echo 第%1題 &echo.
set /a Qskip=%random%%%19
2+(%1-1)38+116
for /F "skip=%Qskip% tokens=1,2 delims=#" %%c in (qt.dat) do (
echo.
echo. %%c
set /a Qline+=1
if !Qline! EQU 2 (
echo.
echo.
set /p answer= 請選擇正確答案:
cls
if /i not "!answer!"=="%%d" set /a errorAw+=1
goto :eof )
)
::
::
:AddQt
echo. &echo. %EoInfo4%%errorAw%枙﹝
echo. &call :showfont "%EoInfo6%"
for /L %%a in (1,1,2) do call :getAddQt %%a
if %errorAw% GEQ 2 (echo.&echo.&echo. %EoInfo4%%errorAw%枙﹝
echo.&echo. %EoInfo5% ^^__^^ &echo.&pause&goto MENU_S )
goto QaPass
::
:getAddQt
set Qline=0
for /L %%a in (1,1,5) do echo.
echo 蜇樓枙%1 &echo.
set /a Qskip=%random%%%28
2+1+(%1-1)56
for /F "skip=%Qskip% tokens=1,2 delims=#" %%c in (qt.dat) do (
echo.
echo. %%c
set /a Qline+=1
if !Qline! EQU 2 (
echo.
echo.
set /p answer= 恁寁淏湘偶ㄩ
cls
if /i not "!answer!"=="%%d" set /a errorAw+=1
goto :eof )
)
::
:AddQt_t
echo. &echo. %EoInfo4%%errorAw%題。
echo. &call :showfont "%EoInfo6%"
for /L %%a in (1,1,2) do call :getAddQt_t %%a
if %errorAw% GEQ 2 (echo.&echo.&echo. %EoInfo4%%errorAw%題。
echo.&echo. %EoInfo5% ^^__^^ &echo.&pause&goto MENU_T )
goto QaPass
::
:getAddQt_t
set Qline=0
for /L %%a in (1,1,5) do echo.
echo 附加題%1 &echo.
set /a Qskip=%random%%%28
2+(%1-1)56+116
for /F "skip=%Qskip% tokens=1,2 delims=#" %%c in (qt.dat) do (
echo.
echo. %%c
set /a Qline+=1
if !Qline! EQU 2 (
echo.
echo.
set /p answer= 請選擇正確答案:
cls
if /i not "!answer!"=="%%d" set /a errorAw+=1
goto :eof ))
::
:QaPass
cls
color 0D
for /L %%a in (1,1,8) do echo.
call :showfont "%EoInfo7%"
goto submenu
::
::
::
:rungame
set /a ProGmJmp=%PgNumb%-1
set /a GmJump=%gmdir%+1
for /L %%a in (0,1,%ProGmJmp%) do call set /a GmJump+=%%GmNumb_%%a%%
for /F "skip=%GmJump% delims=" %%d in (game.lst) do set gmline=%%d&goto DefPara
:DefPara
for /F "tokens=3-14 delims=," %%e in ("!gmline!") do (
set gmfd=%%e
set gmfl=%%f
set gmcs1=%%g
set gmcs2=%%h
set dbcs1=%%i
set dbcs2=%%j
set dbcs3=%%k
set dbcs4=%%l
set dbcs5=%%m
set dbcs6=%%n
set dbcs7=%%o
set dbcs8=%%p)
rem echo %gmcs1%%gmcs2%%dbcs1%%dbcs2%%dbcs3%%dbcs4%%dbcs5%%dbcs6%%dbcs7%%dbcs8%
rem pause
echo.>game.conf
if /i "%dbcs1%"=="" goto gmcs
if /i "%dbcs1%"=="output" (echo [sdl]&echo output=%dbcs2%&echo.)>game.conf else (
if /i "%dbcs1%"=="mouse" (echo [sdl]&echo sensitivity=%dbcs2%&echo.)>game.conf else (
if /i "%dbcs1%"=="cpucy" (echo [cpu]&echo cycles=%dbcs2%&echo.)>game.conf else (
if /i "%dbcs1:~1,2%"=="ms" (echo [dos]&echo %dbcs1%=%dbcs2%&echo.)>game.conf)))
if /i "%dbcs3%"=="" goto gmcs
if /i "%dbcs3%"=="output" (echo [sdl]&echo output=%dbcs4%&echo.)>>game.conf else (
if /i "%dbcs3%"=="mouse" (echo [sdl]&echo sensitivity=%dbcs4%&echo.)>>game.conf else (
if /i "%dbcs3%"=="cpucy" (echo [cpu]&echo cycles=%dbcs4%&echo.)>>game.conf else (
if /i "%dbcs3:~1,2%"=="ms" (echo [dos]&echo %dbcs3%=%dbcs4%&echo.)>>game.conf)))
if /i "%dbcs5%"=="" goto gmcs
if /i "%dbcs5%"=="output" (echo [sdl]&echo output=%dbcs6%&echo.)>>game.conf else (
if /i "%dbcs5%"=="mouse" (echo [sdl]&echo sensitivity=%dbcs6%&echo.)>>game.conf else (
if /i "%dbcs5%"=="cpucy" (echo [cpu]&echo cycles=%dbcs6%&echo.)>>game.conf else (
if /i "%dbcs5:~1,2%"=="ms" (echo [dos]&echo %dbcs5%=%dbcs6%&echo.)>>game.conf)))
if /i "%dbcs7%"=="" goto gmcs
if /i "%dbcs7%"=="output" (echo [sdl]&echo output=%dbcs8%&echo.)>>game.conf else (
if /i "%dbcs7%"=="mouse" (echo [sdl]&echo sensitivity=%dbcs8%&echo.)>>game.conf else (
if /i "%dbcs7%"=="cpucy" (echo [cpu]&echo cycles=%dbcs8%&echo.)>>game.conf else (
if /i "%dbcs7:~1,2%"=="ms" (echo [dos]&echo %dbcs7%=%dbcs8%&echo.)>>game.conf)))
::
:gmcs
(echo [autoexec]&echo cls&echo @echo off&echo mount c . ^>nul)>>game.conf
if /i "%gmcs1%"=="no" goto gmff
if /i "%gmcs1%"=="cdrom" goto cdromcs
if /i "%gmcs1%"=="audio" goto audiocs
if /i "%gmcs1%"=="floppy" (echo mount a .%gmfd% -t floppy -label %gmcs2%)>>game.conf else (
if /i "%gmcs1%"=="img" (echo imgmount d .%gmfd%%gmcs2% -t iso ^>nul)>>game.conf )
goto gmff
::
:audiocs
if /i "%gmcs2%"=="no" (echo imgmount d .\audio.cue -t iso ^>nul)>>game.conf else (
(echo imgmount d .%gmcs2% -t iso ^>nul)>>game.conf )
goto gmff
::
:cdromcs
if /i "%gmcs2%"=="no" (echo mount d .%gmfd% -t cdrom ^>nul)>>game.conf else (
if /i "%gmcs2%"=="local" (call :getcdrom & (echo mount d %CdromName% -t cdrom ^>nul)>>game.conf) else (
echo mount d .%gmfd% -t cdrom -label %gmcs2% ^>nul)>>game.conf )
goto :gmff
::
:getcdrom
for /F "skip=1" %%a in ('fsutil fsinfo drives ^|find /v " "') do (
set DriveName=%%a
for /F "tokens=3" %%z in ('fsutil fsinfo drivetype !DriveName!') do (
set Ccdrom=%%z
if /i "!Ccdrom!"=="CD-ROM" (set CdromName=!DriveName! & goto :eof)
))
::
:gmff
(echo c:&echo cd %gmfd%&echo call %gmfl%&echo exit)>>game.conf
set gmlinex=%gmline:,=%
if /i "%gmlinex:~-10,10%"=="dosbox0.63" (
start dosbox0.63\dosbox -conf game.conf -noconsole %1
) else (
start dosbox\dosbox -conf dosbox\dosbox.conf -conf game.conf -noconsole %1)
goto CURP
::
::
:END
del /f/q TempName.txt stderr.txt stdout.txt game.lst game.conf 1>nul 2>nul
color
del std
.txt
cls


檔案連結-測試用
https://mega.nz/file/Dph2yaTJ#wnHuN4uWEpAluo6IvxHjq_96E63rePE5RJLtPu2tPiA

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
BKY
iT邦好手 1 級 ‧ 2024-07-29 11:22:36
最佳解答

用記事本編輯好之後用另存新檔
編碼選擇用ANSI

jendy
iT邦見習生 ‧ 2024-10-03 10:23:46
【**此則訊息已被站方移除**】

我要發表回答

立即登入回答