@echo off
echo off
if not exist %1\System.ini goto Error
if     exist %1\MSDOS.EXE   goto Error
if not exist %1\System\Commdlg.dll goto Error
if not exist %1\System\ddeml.dll goto Error
if not exist %1\System\shell.dll goto Error

if exist CWin31RC.dat goto L2

if exist CWin31RC.da_ goto L1
A:
if exist CWin31RC.da_ goto L1
B:
if exist CWin31RC.da_ goto L1
goto Error
:L1
expand CWin31RC.DA_ %1\CWin31RC.DAT > nul
expand PutAllRC.EX_ %1\PutAllRC.EXE > nul
%1\PutAllRC %1\CWin31RC.DAT %1
del %1\CWin31RC.DAT
del %1\PutAllRC.EXE

if not exist cwh.da_ goto Exit
if not exist %1\winhelp.exe goto Exit
copy %1\winhelp.exe C:\ >nul
expand PutRes.EX_ C:\PutRes.EXE >nul
expand cwh.da_	  C:\cwh.dat >nul
C:
cd\
if not exist cwh.dat goto Exit
if not exist winhelp.exe goto Exit
if not exist putres.exe goto Exit
Putres cwh.dat
copy winhelp.exe %1 >nul
del winhelp.exe
del cwh.dat
del putres.exe
goto Exit

:L2
PutAllRC CWin31RC.DAT %1

if not exist cwh.dat goto Exit
if not exist %1\winhelp.exe goto Exit
copy %1\winhelp.exe >nul
if not exist winhelp.exe goto Exit
Putres cwh.dat
copy winhelp.exe %1 >nul
del winhelp.exe
goto Exit

:Error
echo [Usage]
echo	TOCC c:\windows
echo where C:\WINDOWS is your Windows 3.1 directory,
:Exit
