# how to add a message when dos starts



## JimZ (Jun 27, 2003)

Does anybody know how to make a welcome message display whenever i run DOS?


----------



## ChEMiX (Jul 17, 2003)

edit c:\autoexec.bat and add some of these:

@echo Welcome to DOS
will make it display "Welcome to DOS" above the command prompt

@cls
will give you a blank screen with the command prompt at the top

@pause
will ask you to press a key to continue

put them together like this
@cls
@echo Welcome to DOS
@pause
and you will get Welcome to DOS at the top of a clear screen, and underneath it will say Press any key to continue... then when you press a key the command prompt will appear

instead of putting @ in front of everything you can just put "echo off" above the commands... if there is no @ or echo off you will see the commands as they are run which looks crap


----------



## JimZ (Jun 27, 2003)

Hello, thanks for the help, where do i put these commands at. for example should they be the first lines when i edit this file?


----------



## plejon (Jul 26, 2001)

Put the commands in the autoexec.bat file.

They can go anywhere you want. Just rember that the autoexec.bat file will probably contain other commands as well, eg the loading of a cd-rom driver. These other commands send text to the screen as well, so decide whether you want your welcome message before or after the driver messages. Personally, I would put welcome at the end. You could even make it something like "welcome to dos. Your system is now started completely and ready for use"


----------



## JimZ (Jun 27, 2003)

What is the best and easiest way to edit this file?


----------



## plejon (Jul 26, 2001)

DOS has an edit command that should be enough to modify the autoexec.bat.

But of course you can use any text editor.


----------



## JimZ (Jun 27, 2003)

I edited the file, but it will not display the message.


----------



## plejon (Jul 26, 2001)

Post the file here, so I can have a look


----------



## JimZ (Jun 27, 2003)

This is the file with no changes made to it, maybe this is the wrong file or something it is label autoexec.bat and the only one i found. thank you for you help!!


@ECHO OFF
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:\;%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 98 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%
echo.
GOTO QUIT

:HELP
cls
call help.bat
echo Your computer will now restart and the startup menu will appear.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
restart.com
GOTO QUIT

:QUIT
echo To get help, type HELP and press ENTER.
echo.
rem clean up environment variables
set CDROM=
set LglDr


----------



## plejon (Jul 26, 2001)

OK, this autoexec file contains some logic. Looks to me that after a sucesful startup, the :QUIT section will be executed. Try adding your welcome text in the quit section

:QUIT
rem clean up environment variables
set CDROM=
set LglDr
CLS (optional, this clears the screen of previous messages)
echo Welcome Professor Falken
echo Shall we play a game?
echo. (optional, echo. inserts an empty line)


----------



## JimZ (Jun 27, 2003)

Hey plejon,
Sorry for the really delayed response i tried putting the echo after the :QUIT but still i get nothing. Any more suggestions?


----------



## plejon (Jul 26, 2001)

Jim,

As I explained before, your autoexec.bat file contains logic. This means that certain parts of the autoexec.bat will/will not be executed based on a prior condition. You autoexec contains four different sections: :ERROR, :EXT, :HELP and :QUIT

To verify the logic of the autoexec, you must try to follow the path the autoexec follows through these sections. The method differs a bit between pure dos or a windows 95/98 machine(see below)

Try this, let me know which sections are executed in which order, and post your modified autoexec.bat again.

Good luck

Peter

***************************************
*Step by Step instructions for pure DOS*

I don't think there's an automatic option to go step by step through the autoexec.

First, remove the @echo off line in the beginning of the autoexec. This instruction "hides" what the autoexec is doing. While this avoids clutter to your screen, it is not helpfull while debugging.

Second: you will see messages on the screen. Try to find out which sections of the autoexec are executed and look for any problems. If the message go too fast, insert a couple of lines with the instruction PAUSE. This will stop the execution of the autoexec until you press a key

****************************************
*Step by Step instructions for pure Windows 95/98*

Reboot the computer 
As the computer is booting press the F8 key when you hear a beep or when you see Starting Windows 95 or Starting Windows 98. Windows 98 users sometimes may find it easier to press and hold the left CTRL key as the computer is booting. 
If done properly you should get to a screen similar to the below screen.

Microsoft Windows 95 Startup Menu
============================= 
1. Normal
2. Logged (\BOOTLOG.TXT)
3. Safe mode
4. Step-by-step confirmation
5. Command prompt only
6. Safe mode command prompt only

Enter a choice: 4

To start Windows 95 using the Step-by-Step Confirmation option, restart Windows, and then press the F8 key when you see the message "Starting Windows 95. . . ." Then, choose Step-by-Step Confirmation from the Startup menu.

To start Windows 98 using the Step-by-Step Confirmation option, press the F8 key as soon as Windows starts to load, choose Safe Mode from the list of startup options, and then choose Step-by-Step Confirmation from the Startup menu.

Windows will display each step of the startup process on-screen and prompt you to confirm each item. Type Y after the prompt (or press Enter) to load the item.

Process your startup command file (Autoexec.bat)?
Type "Y" and press Return. The Autoexec.bat file contains a number of commands that set the environment for DOS and 16-bit Windows applications.


----------

