@echo off

if not exist ff8.dls goto noexist
if not exist 0*.bak goto nobak

attrib -r 000s-lose.sgt
attrib -r 001s-win.sgt
attrib -r 004s-run.sgt
attrib -r 005s-battle.sgt
attrib -r 007s-end.sgt
attrib -r 008s-antena.sgt
attrib -r 009s-waiting.sgt
attrib -r 012s-kani.sgt
attrib -r 013s-battle2.sgt
attrib -r 015s-fuan2.sgt
attrib -r 016s-march2.sgt
attrib -r 017s-joriku.sgt
attrib -r 018s-julia.sgt
attrib -r 019s-waltz.sgt
attrib -r 020s-friend.sgt
attrib -r 021s-dangeon.sgt
attrib -r 022s-pianosol.sgt
attrib -r 024s-march1.sgt
attrib -r 025s-himitsu.sgt
attrib -r 026s-garden.sgt
attrib -r 027s-fuan.sgt
attrib -r 028s-polka2.sgt
attrib -r 029s-anthem.sgt
attrib -r 035s-m7f5.sgt
attrib -r 036s-majo.sgt
attrib -r 041s-field.sgt
attrib -r 043a-concert-tap.sgt
attrib -r 043f-concert-piano.sgt
attrib -r 043g-concert-eguitar.sgt
attrib -r 043h-concert-ebass.sgt
attrib -r 046s-resistan.sgt
attrib -r 047s-kaiso.sgt
attrib -r 048s-horizon.sgt
attrib -r 049s-master.sgt
attrib -r 051s-rinoa.sgt
attrib -r 052s-travia.sgt
attrib -r 053s-antena2.sgt
attrib -r 054s-truth.sgt
attrib -r 055s-jail.sgt
attrib -r 056s-gargarde.sgt
attrib -r 057s-timber.sgt
attrib -r 058s-garbadia.sgt
attrib -r 059s-pinch.sgt
attrib -r 060s-scene1.sgt
attrib -r 061s-pub.sgt
attrib -r 062s-bat3.sgt
attrib -r 063s-stage.sgt
attrib -r 064s-choco.sgt
attrib -r 065s-white.sgt
attrib -r 066s-majomv.sgt
attrib -r 067s-musho.sgt
attrib -r 068s-missile.sgt
attrib -r 069s-enzetu.sgt
attrib -r 070s-card.sgt
attrib -r 071s-gomon.sgt
attrib -r 072s-soto.sgt
attrib -r 073s-majobat.sgt
attrib -r 075s-Gar3.sgt
attrib -r 076s-Bossbat2.sgt
attrib -r 077s-lasdun.sgt
attrib -r 078s-gafly.sgt
attrib -r 079s-demo.sgt
attrib -r 080s-spy.sgt
attrib -r 081s-mods.sgt
attrib -r 082s-salt.sgt
attrib -r 083s-alien.sgt
attrib -r 084s-sekichu.sgt
attrib -r 085s-esta.sgt
attrib -r 086s-moonmv.sgt
attrib -r 089s-hikutei.sgt
attrib -r 090s-bossbat1.sgt
attrib -r 091s-rag1.sgt
attrib -r 092s-rag2.sgt
attrib -r 093s-lasboss.sgt
attrib -r 096s-keisho.sgt
attrib -r 097s-ashuku.sgt
attrib -r 099-joriku2.sgt
attrib -r 014s-Parade2.sgt
attrib -r 023s-Parade.sgt
attrib -r chocoworld.sgt

if exist 000s-lose.bak copy 000s-lose.bak 000s-lose.sgt /y > nul
if exist 001s-win.bak copy 001s-win.bak 001s-win.sgt /y > nul
if exist 004s-run.bak copy 004s-run.bak 004s-run.sgt /y > nul
if exist 005s-battle.bak copy 005s-battle.bak 005s-battle.sgt /y > nul
if exist 007s-end.bak copy 007s-end.bak 007s-end.sgt /y > nul
if exist 008s-antena.bak copy 008s-antena.bak 008s-antena.sgt /y > nul
if exist 009s-waiting.bak copy 009s-waiting.bak 009s-waiting.sgt /y > nul
if exist 012s-kani.bak copy 012s-kani.bak 012s-kani.sgt /y > nul
if exist 013s-battle2.bak copy 013s-battle2.bak 013s-battle2.sgt /y > nul
if exist 015s-fuan2.bak copy 015s-fuan2.bak 015s-fuan2.sgt /y > nul
if exist 016s-march2.bak copy 016s-march2.bak 016s-march2.sgt /y > nul
if exist 017s-joriku.bak copy 017s-joriku.bak 017s-joriku.sgt /y > nul
if exist 018s-julia.bak copy 018s-julia.bak 018s-julia.sgt /y > nul
if exist 019s-waltz.bak copy 019s-waltz.bak 019s-waltz.sgt /y > nul
if exist 020s-friend.bak copy 020s-friend.bak 020s-friend.sgt /y > nul
if exist 021s-dangeon.bak copy 021s-dangeon.bak 021s-dangeon.sgt /y > nul
if exist 022s-pianosol.bak copy 022s-pianosol.bak 022s-pianosol.sgt /y > nul
if exist 024s-march1.bak copy 024s-march1.bak 024s-march1.sgt /y > nul
if exist 025s-himitsu.bak copy 025s-himitsu.bak 025s-himitsu.sgt /y > nul
if exist 026s-garden.bak copy 026s-garden.bak 026s-garden.sgt /y > nul
if exist 027s-fuan.bak copy 027s-fuan.bak 027s-fuan.sgt /y > nul
if exist 028s-polka2.bak copy 028s-polka2.bak 028s-polka2.sgt /y > nul
if exist 029s-anthem.bak copy 029s-anthem.bak 029s-anthem.sgt /y > nul
if exist 035s-m7f5.bak copy 035s-m7f5.bak 035s-m7f5.sgt /y > nul
if exist 036s-majo.bak copy 036s-majo.bak 036s-majo.sgt /y > nul
if exist 041s-field.bak copy 041s-field.bak 041s-field.sgt /y > nul
if exist 043a-concert-tap.bak copy 043a-concert-tap.bak 043a-concert-tap.sgt /y > nul
if exist 043f-concert-piano.bak copy 043f-concert-piano.bak 043f-concert-piano.sgt /y > nul
if exist 043g-concert-eguitar.bak copy 043g-concert-eguitar.bak 043g-concert-eguitar.sgt /y > nul
if exist 043h-concert-ebass.bak copy 043h-concert-ebass.bak 043h-concert-ebass.sgt /y > nul
if exist 046s-resistan.bak copy 046s-resistan.bak 046s-resistan.sgt /y > nul
if exist 047s-kaiso.bak copy 047s-kaiso.bak 047s-kaiso.sgt /y > nul
if exist 048s-horizon.bak copy 048s-horizon.bak 048s-horizon.sgt /y > nul
if exist 049s-master.bak copy 049s-master.bak 049s-master.sgt /y > nul
if exist 051s-rinoa.bak copy 051s-rinoa.bak 051s-rinoa.sgt /y > nul
if exist 052s-travia.bak copy 052s-travia.bak 052s-travia.sgt /y > nul
if exist 053s-antena2.bak copy 053s-antena2.bak 053s-antena2.sgt /y > nul
if exist 054s-truth.bak copy 054s-truth.bak 054s-truth.sgt /y > nul
if exist 055s-jail.bak copy 055s-jail.bak 055s-jail.sgt /y > nul
if exist 056s-gargarde.bak copy 056s-gargarde.bak 056s-gargarde.sgt /y > nul
if exist 057s-timber.bak copy 057s-timber.bak 057s-timber.sgt /y > nul
if exist 058s-garbadia.bak copy 058s-garbadia.bak 058s-garbadia.sgt /y > nul
if exist 059s-pinch.bak copy 059s-pinch.bak 059s-pinch.sgt /y > nul
if exist 060s-scene1.bak copy 060s-scene1.bak 060s-scene1.sgt /y > nul
if exist 061s-pub.bak copy 061s-pub.bak 061s-pub.sgt /y > nul
if exist 062s-bat3.bak copy 062s-bat3.bak 062s-bat3.sgt /y > nul
if exist 063s-stage.bak copy 063s-stage.bak 063s-stage.sgt /y > nul
if exist 064s-choco.bak copy 064s-choco.bak 064s-choco.sgt /y > nul
if exist 065s-white.bak copy 065s-white.bak 065s-white.sgt /y > nul
if exist 066s-majomv.bak copy 066s-majomv.bak 066s-majomv.sgt /y > nul
if exist 067s-musho.bak copy 067s-musho.bak 067s-musho.sgt /y > nul
if exist 068s-missile.bak copy 068s-missile.bak 068s-missile.sgt /y > nul
if exist 069s-enzetu.bak copy 069s-enzetu.bak 069s-enzetu.sgt /y > nul
if exist 070s-card.bak copy 070s-card.bak 070s-card.sgt /y > nul
if exist 071s-gomon.bak copy 071s-gomon.bak 071s-gomon.sgt /y > nul
if exist 072s-soto.bak copy 072s-soto.bak 072s-soto.sgt /y > nul
if exist 073s-majobat.bak copy 073s-majobat.bak 073s-majobat.sgt /y > nul
if exist 075s-Gar3.bak copy 075s-Gar3.bak 075s-Gar3.sgt /y > nul
if exist 076s-Bossbat2.bak copy 076s-Bossbat2.bak 076s-Bossbat2.sgt /y > nul
if exist 077s-lasdun.bak copy 077s-lasdun.bak 077s-lasdun.sgt /y > nul
if exist 078s-gafly.bak copy 078s-gafly.bak 078s-gafly.sgt /y > nul
if exist 079s-demo.bak copy 079s-demo.bak 079s-demo.sgt /y > nul
if exist 080s-spy.bak copy 080s-spy.bak 080s-spy.sgt /y > nul
if exist 081s-mods.bak copy 081s-mods.bak 081s-mods.sgt /y > nul
if exist 082s-salt.bak copy 082s-salt.bak 082s-salt.sgt /y > nul
if exist 083s-alien.bak copy 083s-alien.bak 083s-alien.sgt /y > nul
if exist 084s-sekichu.bak copy 084s-sekichu.bak 084s-sekichu.sgt /y > nul
if exist 085s-esta.bak copy 085s-esta.bak 085s-esta.sgt /y > nul
if exist 086s-moonmv.bak copy 086s-moonmv.bak 086s-moonmv.sgt /y > nul
if exist 089s-hikutei.bak copy 089s-hikutei.bak 089s-hikutei.sgt /y > nul
if exist 090s-bossbat1.bak copy 090s-bossbat1.bak 090s-bossbat1.sgt /y > nul
if exist 091s-rag1.bak copy 091s-rag1.bak 091s-rag1.sgt /y > nul
if exist 092s-rag2.bak copy 092s-rag2.bak 092s-rag2.sgt /y > nul
if exist 093s-lasboss.bak copy 093s-lasboss.bak 093s-lasboss.sgt /y > nul
if exist 096s-keisho.bak copy 096s-keisho.bak 096s-keisho.sgt /y > nul
if exist 097s-ashuku.bak copy 097s-ashuku.bak 097s-ashuku.sgt /y > nul
if exist 099-joriku2.bak copy 099-joriku2.bak 099-joriku2.sgt /y > nul
if exist 014s-Parade2.bak copy 014s-Parade2.bak 014s-Parade2.sgt /y > nul
if exist 023s-Parade.bak copy 023s-Parade.bak 023s-Parade.sgt /y > nul
if exist chocoworld.bak copy chocoworld.bak chocoworld.sgt /y > nul
deltree /y 0*.bak > nul
deltree /y chocoworld.bak > nul

echo.
echo All SGTs successfully restored.
echo.

goto end

:nobak
echo.
echo Backup files not found !
echo.
goto end

:noexist
echo.
echo Files to restore not found !
echo.
echo This batch file must be executed in "FF8_directory\Data\Music\dmusic"

:end
