@echo off

echo SCHEMES.BAT installs the cursor scheme Control Panel applet (schemes.cpl)
echo in your %systemroot%\system32 directory and renames cursors.cpl
echo to cursors.old.
echo.
echo Make sure your current directory is the directory where you
echo installed the Resource Kit tools.
echo.
echo You must be logged on as a member of the Administrators group
echo to install the schemes applet and Control Panel must not be open.
echo.
pause
echo.

if not exist .\schemes.cpl goto ERROR_SCHEMES_MISSING
if exist %systemroot%\system32\schemes.cpl goto ALREADY_INSTALLED
if not exist %systemroot%\system32\cursors.cpl goto COPY_SCHEMES

copy %systemroot%\system32\cursors.cpl %systemroot%\system32\cursors.old
if errorlevel 1 goto ERROR_COULD_NOT_COPY

del %systemroot%\system32\cursors.cpl
if exist %systemroot%\system32\cursors.cpl goto ERROR_COULD_NOT_DEL

:COPY_SCHEMES
copy .\schemes.cpl %systemroot%\system32
if not exist %systemroot%\system32\schemes.cpl goto ERROR_COULD_NOT_INSTALL

echo.
echo The cursor scheme Control Panel applet (schemes.cpl) was installed
echo correctly.  To use it, open Control Panel and click on the dinosaur
echo icon.
goto END

:NO_CURSORS_APPLET

:ERROR_COULD_NOT_DEL
echo.
echo Could not delete %systemroot%\system32\cursors.cpl
echo Make sure you are logged on as a member of the Administrators
echo group and that you have Delete access to cursors.cpl.
echo Close Control Panel if it is open.  Then try running SCHEMES.BAT
echo again.
goto END

:ERROR_COULD_NOT_INSTALL
echo.
echo Could not copy schemes.cpl into the %systemroot%\system32 directory.
echo Make sure that you are logged on as a member of the Administrators
echo group and that you have Change/Write access to the
echo %systemroot%\system32 directory.
echo goto END

:ERROR_COULD_NOT_COPY
echo.
echo Could not copy %systemroot%\system32\cursors.cpl to
echo %systemroot%\system32\cursors.old.
echo Make sure you are logged on as a member of the Administrators
echo group and that you have Read access to cursors.cpl
echo If cursors.old already exists, delete it.
goto END

:ALREADY_INSTALLED
echo.
echo The schemes.cpl Control Panel applet is already installed on your
echo computer.
goto END

:ERROR_SCHEMES_MISSING
echo.
echo Could not find schemes.cpl in the current directory.
echo Make sure the current directory is the directory that contains
echo the Resource Kit files.  If schemes.cpl is not in the Resource
echo Kit directory, copy it from the original Resource Kit floppy
echo disks or CD-ROM.
goto END

:END
