@echo off
REM Argument #1 must be the source drive

echo.

set DEST=C:\VIET\TTF

if exist %DEST%\NUL goto skip
echo Creating %DEST%
mkdir %DEST%

:skip
expand %1\..\WINVNKEY\hmh___11.tt_ %DEST%\hmh___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\hm____11.tt_ %DEST%\hm____11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\hyh___11.tt_ %DEST%\hyh___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\hy____11.tt_ %DEST%\hy____11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\mqh___11.tt_ %DEST%\mqh___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\mq____11.tt_ %DEST%\mq____11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\uhh___11.tt_ %DEST%\uhh___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\uh____11.tt_ %DEST%\uh____11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\thh___11.tt_ %DEST%\thh___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\th____11.tt_ %DEST%\th____11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\amh___11.tt_ %DEST%\amh___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\am____11.tt_ %DEST%\am____11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\pth___11.tt_ %DEST%\pth___11.ttf
if errorlevel 1 goto exerr
expand %1\..\WINVNKEY\pt____11.tt_ %DEST%\pt____11.ttf
if errorlevel 1 goto exerr

copy %1\..\TTF\NOTICE %DEST% > %DEST%\nul
copy %1\..\TTF\BAOGIO.WRI %DEST% > %DEST%\nul
copy %1\..\TTF\README.TXT %DEST% > %DEST%\nul

goto done

:mderr
echo .
echo ERROR: Cannot create directory %DEST%
exit 1

:exerr
echo .
echo ERROR: Cannot run EXPAND on font files
exit 1

:done
exit 0
