AUTOEXEC.BAT AUTOEXEC.BAT is a batch file that is executed by MS-DOS automatically on its start-up, so you can put commands that you want to execute on start-ups of your computer into AUTOEXEC.BAT. Usually, in old versions of MS-DOS (older than MS-DOS 6.0), the appearance of MS-DOS command prompt is $N$G by default. In MS-DOS versions not lower than 6.0, the appearance of MS-DOS prompt is $P$G by default. You can make the appearance of MS-DOS prompt change every time your computer starts up by adding a PROMPT command in your AUTOEXEC.BAT file. If there is no AUTOEXEC.BAT file available on your start-up disk, MS-DOS asks for date and time on computer start-up. If there is AUTOEXEC.BAT file on your start-up disk, MS-DOS will execute commands in AUTOEXEC.BAT file instead of asking for date and time. You can load TSRs using AUTOEXEC.BAT file. Also, you can run initialization programs using AUTOEXEC.BAT. You should optimize memory usage if you use TSRs. To do this, use XMS management program and EMS management program in your CONFIG.SYS and use LH command in your AUTOEXEC.BAT file. To optimize disk performance, you can run SMARTDRV.EXE in your AUTOEXEC.BAT file. To access CDROM drive, you can run MSCDEX.EXE in your AUTOEXEC.BAT file while at the same time, install a CDROM device driver in your CONFIG.SYS. Usually, you can find a versatile ATAPI CDROM driver for MS-DOS: IDE.SYS, on the web. To make such a configuration, add "DEVICE=IDE.SYS /D:MSCD000" in your CONFIG.SYS file and add "MSCDEX.EXE /D:MSCD000" in your AUTOEXEC.BAT file. There are other options that you can add to speed up your work. You can add "SET DIRCMD=/P/O" to let MS-DOS automatically use "/P/O" switches when you use DIR command. Also, you can add "BREAK=ON" if you want to break a program using Ctrl+C whenever there is a I/O operation (by default, Ctrl+C will take effect only when writing to screen or reading from keyboard). You can see here a copy of the AUTOEXEC.BAT file on a Windows Millennium start-up disk: -------- AUTOEXEC.BAT -------- @ECHO OFF path=c:\windows;c:\windows\command \hibinv.exe call \checksr.bat IF "%config%"=="QUICK" GOTO QUICK set EXPAND=YES SET DIRCMD=/O:N set LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T 19 S 18 R 17 Q 16 P 15 set LglDrv=%LglDrv% O 14 N 13 M 12 L 11 K 10 J 9 I 8 H 7 G 6 F 5 E 4 D 3 C cls call setramd.bat %LglDrv% set temp=c:\ set tmp=c:\ path=%RAMD%:\;a:\;%path%;%CDROM%:\ copy command.com %RAMD%:\ > NUL set comspec=%RAMD%:\command.com copy extract.exe %RAMD%:\ > NUL copy readme.txt %RAMD%:\ > NUL :ERROR IF EXIST ebd.cab GOTO EXT echo Please insert Windows Millennium Edition Startup Disk 2 echo. pause GOTO ERROR :EXT %RAMD%:\extract /y /e /l %RAMD%: ebd.cab > NUL echo The diagnostic tools were successfully loaded to drive %RAMD%. echo. IF "%config%"=="NOCD" GOTO QUIT IF "%config%"=="HELP" GOTO HELP LH %ramd%:\MSCDEX.EXE /D:mscd001 /L:%CDROM% ::If MSCDEX doesn't find a drive... IF ERRORLEVEL 1 SET CDPROB=1 :: GOTO QUIT :HELP LH %ramd%:\MSCDEX.EXE /D:mscd001 /L:%CDROM% ::If MSCDEX doesn't find a drive... IF ERRORLEVEL 1 SET CDPROB=1 cls call help.bat :: GOTO QUIT :QUIT call fixit.bat rem clean up environment variables set CDPROB= set CDROM= set LglDrv= GOTO QUICK :QUICK -------- End of the file -------- And here is the SETRAMD.BAT file: -------- SETRAMD.BAT -------- @echo off set RAMD= set CDROM= echo. echo Preparing to start your computer. echo This may take a few minutes. Please wait... echo. a:\findramd if errorlevel 255 goto no_ramdrive if not errorlevel 3 goto no_ramdrive goto do_shift :loop if errorlevel %1 goto no_shift :do_shift set cdrom=%2 shift shift if not %1*==* goto loop goto no_ramdrive :no_shift set ramd=%2 if "%RAMD%"=="C" goto c_drive goto success :c_drive echo Windows Millennium Edition has detected that drive C does not contain a valid echo FAT or FAT32 partition. There are several possible causes. echo. echo 1. The drive may need to be partitioned. To create a partition on the drive, echo run FDISK from the MS-DOS command prompt. echo. echo 2. You may be using third-party disk-partitioning software. If you are using echo this type of software, remove the Emergency Boot Disk and restart your echo computer. Then, follow the on-screen instructions to start your computer from echo a floppy disk. echo . echo 3. Some viruses also cause your drive C to not register. You can use a virus echo scanning program to check your computer for viruses. echo. goto success :no_ramdrive echo The Windows Millennium Edition startup disk could not create a temporary drive echo for the diagnostic tools. This may be because this computer has less than the echo minimum required extended memory. echo. :success -------- End of the file --------