@echo off
echo Starting DOS patch.
echo. | date
echo. | time
echo Starting DOS patch. >c3patch.log
echo. | date >>c3patch.log
echo. | time >>c3patch.log

:ckdd2l

if ".%3"=="./l" goto psin2l
if ".%3"=="./L" goto psin2l
goto dskd2l
:psin2l

if exist %1\disk2l.mid goto dskd2l
echo.
echo Please insert disk #2 into %1
echo Please insert disk #2 into %1 >>c3patch.log
echo.
pause
goto ckdd2l

:dskd2l

if ".%3"=="./l" goto pscp2l02
if ".%3"=="./L" goto pscp2l02
goto okd2l03
:pscp2l02

echo.
echo Copying/patching DOS file #1 of 1 from disk #2
echo. >>c3patch.log
echo Copying/patching DOS file #1 of 1 from disk #2 >>c3patch.log
copy %1\c2_c3_ld.rtp .

echo.
echo Patching the DOS Locked AutoCAD executable.
echo This will take a while...
echo. >>c3patch.log
echo Patching the DOS Locked AutoCAD executable. >>c3patch.log
echo This will take a while... >>c3patch.log
echo.
echo .\patch . c2_c3_ld.rtp >>c3patch.log
.\patch . c2_c3_ld.rtp >>c3patch.log
if errorlevel 1 goto nod2l01
echo.
echo DOS Locked AutoCAD executable successfully patched.
echo DOS Locked AutoCAD executable successfully patched. >>c3patch.log
echo.
rem pause
goto okd2l02

:nod2l01

echo.
echo Patch of DOS Locked AutoCAD executable failed!
echo Patch of DOS Locked AutoCAD executable failed! >>c3patch.log
goto patchdie

:okd2l02
del c2_c3_ld.rtp
:okd2l03

:ckdd2u

if ".%3"=="./u" goto psin2u
if ".%3"=="./U" goto psin2u
goto dskd2u
:psin2u

if exist %1\disk2u.mid goto dskd2u
echo.
echo Please insert disk #2 into %1
echo Please insert disk #2 into %1 >>c3patch.log
echo.
pause
goto ckdd2u

:dskd2u

if ".%3"=="./u" goto pscp2u02
if ".%3"=="./U" goto pscp2u02
goto okd2u03
:pscp2u02

echo.
echo Copying/patching DOS file #1 of 1 from disk #2
echo. >>c3patch.log
echo Copying/patching DOS file #1 of 1 from disk #2 >>c3patch.log
copy %1\c2_c3_ud.rtp .

echo.
echo Patching the DOS Unlocked AutoCAD executable.
echo This will take a while...
echo. >>c3patch.log
echo Patching the DOS Unlocked AutoCAD executable. >>c3patch.log
echo This will take a while... >>c3patch.log
echo.
echo .\patch . c2_c3_ud.rtp >>c3patch.log
.\patch . c2_c3_ud.rtp >>c3patch.log
if errorlevel 1 goto nod2u01
echo.
echo DOS Unlocked AutoCAD executable successfully patched.
echo DOS Unlocked AutoCAD executable successfully patched. >>c3patch.log
echo.
rem pause
goto okd2u02

:nod2u01

echo.
echo Patch of DOS Unlocked AutoCAD executable failed!
echo Patch of DOS Unlocked AutoCAD executable failed! >>c3patch.log
goto patchdie

:okd2u02
del c2_c3_ud.rtp
:okd2u03

echo Running the DOS Phar Lap switch installation.
echo. >>c3patch.log
echo Running the DOS Phar Lap switch installation. >>c3patch.log
echo.
echo cfig386 acad.exe -minwork 2000000 -maxfiles 50 >>c3patch.log
echo. >>c3patch.log
cfig386 acad.exe -minwork 2000000 -maxfiles 50 >>c3patch.log
if errorlevel 1 goto nodUsr01
echo.
echo DOS Phar Lap switch installation succeeded.
echo DOS Phar Lap switch installation succeeded. >>c3patch.log
echo.
rem pause
goto okdUsr02

:nodUsr01

echo.
echo DOS Phar Lap switch installation failed!
echo DOS Phar Lap switch installation failed! >>c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okdUsr02

:ckdd1

if exist %1\disk1.mid goto dskd1
echo.
echo Please insert disk #1 into %1
echo Please insert disk #1 into %1 >>c3patch.log
echo.
pause
goto ckdd1

:dskd1

echo.
echo Copying DOS file #1 of 4 from disk #1
echo. >>c3patch.log
echo Copying DOS file #1 of 4 from disk #1 >>c3patch.log
copy %1\readc3.txt .

echo.
echo Copying/patching DOS file #2 of 4 from disk #1
echo. >>c3patch.log
echo Copying/patching DOS file #2 of 4 from disk #1 >>c3patch.log
copy %1\2_3_acis.rtp .

echo.
echo Patching the DOS ACIS Library.
echo. >>c3patch.log
echo Patching the DOS ACIS Library. >>c3patch.log
echo.
echo .\patch . 2_3_acis.rtp >>c3patch.log
.\patch . 2_3_acis.rtp >>c3patch.log
if errorlevel 1 goto nod111
echo.
echo DOS ACIS Library successfully patched.
echo DOS ACIS Library successfully patched. >>c3patch.log
echo.
rem pause
goto okd112

:nod111

echo.
echo Patch of DOS ACIS Library failed!
echo Patch of DOS ACIS Library failed! >>c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okd112
del 2_3_acis.rtp
:okd113

echo.
echo Copying/patching DOS file #3 of 4 from disk #1
echo. >>c3patch.log
echo Copying/patching DOS file #3 of 4 from disk #1 >>c3patch.log
copy %1\2_3_seud.rtp .

echo.
echo Patching the DOS Localized files.
echo. >>c3patch.log
echo Patching the DOS Localized files. >>c3patch.log
echo.
echo .\patch . 2_3_seud.rtp >>c3patch.log
.\patch . 2_3_seud.rtp >>c3patch.log
if errorlevel 1 goto nod121
echo.
echo DOS Localized files successfully patched.
echo DOS Localized files successfully patched. >>c3patch.log
echo.
rem pause
goto okd122

:nod121

echo.
echo Patch of DOS Localized files failed!
echo Patch of DOS Localized files failed! >>c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okd122
del 2_3_seud.rtp
:okd123

echo.
echo Copying/patching DOS file #4 of 4 from disk #1
echo. >>c3patch.log
echo Copying/patching DOS file #4 of 4 from disk #1 >>c3patch.log
copy %1\2_3_sgud.rtp .

echo.
echo Patching the DOS Globalized files.
echo. >>c3patch.log
echo Patching the DOS Globalized files. >>c3patch.log
echo.
echo .\patch . 2_3_sgud.rtp >>c3patch.log
.\patch . 2_3_sgud.rtp >>c3patch.log
if errorlevel 1 goto nod131
echo.
echo DOS Globalized files successfully patched.
echo DOS Globalized files successfully patched. >>c3patch.log
echo.
rem pause
goto okd132

:nod131

echo.
echo Patch of DOS Globalized files failed!
echo Patch of DOS Globalized files failed! >>c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okd132
del 2_3_sgud.rtp
:okd133
   
if exist %2\c3patch.log copy %2\c3patch.log %2\c3patch.win
echo Starting Common patch. >%2\c3patch.log
echo. | date >>%2\c3patch.log
echo. | time >>%2\c3patch.log
if not exist %2\c3patch.win goto docom
echo Common files already updated by earlier Windows update. >>%2\c3patch.log
goto cdfrmcom
:docom

echo.
echo Copying/patching Common file #1 of 2 from disk #1
echo. >>%2\c3patch.log
echo Copying/patching Common file #1 of 2 from disk #1 >>%2\c3patch.log
copy %1\2_3_seuc.rtp .

echo.
echo Patching the Common AutoLISP files.
echo. >>%2\c3patch.log
echo Patching the Common AutoLISP files. >>%2\c3patch.log
echo.
echo .\patch %2 2_3_seuc.rtp >>%2\c3patch.log
.\patch %2 2_3_seuc.rtp >>%2\c3patch.log
if errorlevel 1 goto noc101
echo.
echo Common AutoLISP files successfully patched.
echo Common AutoLISP files successfully patched. >>%2\c3patch.log
echo.
rem pause
goto okc102

:noc101

echo.
echo Patch of Common AutoLISP files failed!
echo Patch of Common AutoLISP files failed! >>%2\c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okc102
del 2_3_seuc.rtp
:okc103

echo.
echo Copying/patching Common file #2 of 2 from disk #1
echo. >>%2\c3patch.log
echo Copying/patching Common file #2 of 2 from disk #1 >>%2\c3patch.log
copy %1\2_3_sguc.rtp .

echo.
echo Patching the Common Support files.
echo. >>%2\c3patch.log
echo Patching the Common Support files. >>%2\c3patch.log
echo.
echo .\patch %2 2_3_sguc.rtp >>%2\c3patch.log
.\patch %2 2_3_sguc.rtp >>%2\c3patch.log
if errorlevel 1 goto noc111
echo.
echo Common Support files successfully patched.
echo Common Support files successfully patched. >>%2\c3patch.log
echo.
rem pause
goto okc112

:noc111

echo.
echo Patch of Common Support files failed!
echo Patch of Common Support files failed! >>%2\c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okc112
del 2_3_sguc.rtp
:okc113

:cdfrmcom

echo.
echo Patch DOS ASE files?
echo Press CTRL-C to exit now  --OR--
pause

:ckdd4

if exist %1\disk4.mid goto dskd4
echo.
echo Please insert disk #4 into %1
echo Please insert disk #4 into %1 >>c3patch.log
echo.
pause
goto ckdd4

:dskd4

echo.
echo Copying/patching DOS file #2 of 2 from disk #4
echo. >>c3patch.log
echo Copying/patching DOS file #2 of 2 from disk #4 >>c3patch.log
copy %1\2_3_ased.rtp .

echo.
echo Patching the DOS ASE files.
echo This will take a while...
echo. >>c3patch.log
echo Patching the DOS ASE files. >>c3patch.log
echo This will take a while... >>c3patch.log
echo.
echo .\patch . 2_3_ased.rtp >>c3patch.log
.\patch . 2_3_ased.rtp >>c3patch.log
if errorlevel 1 goto nod411
echo.
echo DOS ASE files successfully patched.
echo DOS ASE files successfully patched. >>c3patch.log
echo.
rem pause
goto okd412

:nod411

echo.
echo Patch of DOS ASE files failed!
echo Patch of DOS ASE files failed! >>c3patch.log
echo.
echo Press CTRL-C to exit now  --OR--
pause

:okd412
del 2_3_ased.rtp
:okd413

:patchdie
del patch.exe
