echo off
IF NOT EXIST IMONCE.BAT GOTO HELP
SET IMD=%1
if "%1" == "" goto Cinst
goto NotCinst
:CINST
SET IMD=c:
:NotCinst
IF NOT EXIST %IMD%\AUTOEXEC.BAT GOTO HELP
COPY %IMD%\AUTOEXEC.BAT %IMD%\AUTOEXEC.BAK
COPY %IMD%\AUTOEXEC.BAK + IMonce.BAT %IMD%\AUTOEXEC.BAT
GOTO DONE
:HELP
ECHO ˙˙
ECHO There is a missing file. Please check that
ECHO ˙˙
ECHO 1) You have file IMonce.BAT in the current directory
ECHO 2) Your AUTOEXEC.BAT file is on disk %IMD%. (You can specify which disk
ECHO    to use on the command line.
ECHO    For example, type:  "IMAUTO D:" if you boot from disk D.
GOTO EXIT
:DONE
ECHO ˙˙
ECHO IMauto modifies your AUTOEXEC.BAT file so that IM will be executed
ECHO once a day in quick update mode on your boot disk. This will detect
ECHO system changes along with known viruses.
ECHO ˙˙
ECHO The old version of your AUTOEXEC.BAT is saved as file AUTOEXEC.BAK
ECHO ˙˙
ECHO *** You will need to copy the following files˙into a directory on your
ECHO *** DOS PATH (if you haven't done so already):
ECHO ***
ECHO ***         IM.EXE
ECHO ***         IM.PRM
ECHO ***   RUNMAYBE.EXE
ECHO ***
ECHO *** You can execute IMCOPY to copy these programs to C:\DOS.
ECHO *** If your directory is elsewhere, such as "D:\DOS62" just
ECHO *** enter the command: "IMCOPY D:\DOS62"  (without the quotes)
:EXIT
