|
-
July 10th, 2002, 03:46 AM
#1
[RESOLVED] How Does D.O.S. do this?
ok I got this old computer to mess with, it was a Tandy, and it had a 720k floppy drive! looked inside, interesting, now I boot it up, it say MSdos 4.0 and then whoa and behold a Bible verse comes up and stays up for 5 seconds then continues with The tandy UI.
and the bible verses are random.
So How is dos able to do this? How Does it get a program to run for 5 seconds? then continues??????
Can you tell me?
-
July 10th, 2002, 07:36 AM
#2
Those kinds of programs have been available for quite a while. I'm not that familiar with TANDY but if it's running DOS there is likely an autoexec.bat file. If so there is no doubt a line pointing to a biblevrs.exe or some such program. In the directory listings you should find the program.
tiberiuscan
-
July 10th, 2002, 04:22 PM
#3
how do i create one? ive wondered that as well.
one computer i looked at said " get out while you still can!!"
-
July 10th, 2002, 06:00 PM
#4
John Dos,
When you stop to consider it, it's no different from DOS starting HIMEM.SYS in the CONFIG.SYS and moving on, or starting MSCDEX.EXE in the AUTOEXEC.BAT and moving on.
The Lord may move in mysterious ways, but DOS is pretty predictable.
Welcome to the Eclipse(C). The Evolution of an Idea
Options: DCM3 LCR VMS CVM Sil CPI VMI ANI 648 CA1 SACD500 Att CID RLS TIME DLG
Version: ECLIPSE 2.0.0 09/09/98 System is BUSY Thu 07-21-05 1:31 pm
Access Level = 10 Port = 10
-
July 11th, 2002, 03:16 AM
#5
yes but Himem.sys is working, lets say you have a program that just Prints Hi! by the cursor, well while booting up It will say Hi! then go to the command prompt, just running a program that says Hi! well how would you read it? it would go so fast you couldn't, lets say DOS is on a 1Gig processor! will you see the words hi? still? BAM WHAM, Thank you Mam!
-
July 11th, 2002, 05:54 AM
#6
The following command printsand pauses for 3 seconds
Code:
choice/c./t.,3/n"Hi!"
(You can change that 3 from any number from 1 to 99 [seconds]).
-
July 11th, 2002, 11:03 AM
#7
You should be able to read your auto exec.bat file by typing
c:\type autoexec.bat
To edit you can use the c:\edit autoexec.bat (or c:\edlin autoexec.bat in some earlier version of DOS).
Before you mess with autoexec.bat though be sure you have a backup copy. It is possible to save your original as autoexec.old if you'd like.
tiberiuscan
-
July 11th, 2002, 04:14 PM
#8
Vernon I don't think the choice command came out until DOS 6.0. However it can be used with DOS 4.0. If there is an EXE file called by the AUTOEXEC.BAT, it most likely has those features built into it.
You could have rotating files selected either ramdomly at boot by the program or a fixed file which is randomly replace each time you boot from a selection of files.
Many of those features were around long before Microsoft decided to incorporate them into DOS.
------------------
My
Two Cents
Dennis
Visit Politalk
-
July 11th, 2002, 07:13 PM
#9
Originally posted by tiberiuscan
You should be able to read your auto exec.bat file by typing
c:\type autoexec.bat
To edit you can use the c:\edit autoexec.bat (or c:\edlin autoexec.bat in some earlier version of DOS).
Before you mess with autoexec.bat though be sure you have a backup copy. It is possible to save your original as autoexec.old if you'd like.
type is a DOS internal command, therefore if you issued the command c:\type autoexec.bat then you'd need some sort of program in the root directory of C: with the name type and the extension of .bat, .com, or .exe, otherwise, you will get the message "Bad command or filename".
edit and edlin are DOS external commands, and as such are typically in the \DOS directory. EDLIN.EXE was all you got in DOS 5.0, but EDIT.COM was introduced in version 6.0. As these are external commands, issuing the command c:\edit autoexec.bat or c:\edlin autoexec.bat will result in a "Bad command or filename" error unless the executable is in the root directory. DOS is very picky about this!
We can usually assume that at boot the path is already set up correctly, so we can declare the path to a file for the benefit of the program we are calling but we don't need to declare the path to the program. Therefore, these commands should work just fine, if the associated program is in the path:
- edit c:\autoexec.bat
type c:\autoexec.bat
edlin c:\autoexec.bat
If you happen to be in the root directory when giving the commands, you really don't need to specify the path to the file, but it is probably a good idea anyway so that you may be sure the specific file is referenced by the program.
Welcome to the Eclipse(C). The Evolution of an Idea
Options: DCM3 LCR VMS CVM Sil CPI VMI ANI 648 CA1 SACD500 Att CID RLS TIME DLG
Version: ECLIPSE 2.0.0 09/09/98 System is BUSY Thu 07-21-05 1:31 pm
Access Level = 10 Port = 10
-
July 12th, 2002, 05:07 AM
#10
Eeyore> Vernon I don't think the choice command came out until DOS 6.0. However it can be used with DOS 4.0.
Correct on both counts. (I wasn't paying close enough attention. :()
You can view which MS-DOS programs were included in various versions on this Microsoft KB page: MS-DOS Command Extension Table by Version (Q72188)
And you can see the string "CHOICE: requires MS-DOS version 4.0 or later." within CHOICE.COM. For example, if you're at a Windows 9x/Me DOS prompt, type:- find "requires" c:\windows\command\choice.com
If you're at a MS-DOS 5.00 or 6.xx prompt, try:- find "requires" c:\dos\choice.com
Here's an example that should work in a standard installation of MS-DOS 4.00 up through at least Windows 98SE:
Code:
@echo off
echo [...other DOS commands...]
echo.
echo Hi!
echo.
echo [...pausing 5 seconds...]
echo nwait.com>~tmp.scr
echo e0100 BE 81 00 AC 3C 20 74 FB 4E 81 3C 2F 3F 75 0A BA>>~tmp.scr
echo e0110 B9 01 B4 09 CD 21 E9 9C 00 2B C0 2A FF B9 0A 00>>~tmp.scr
echo e0120 BD 10 0E 8A 1C 80 EB 30 80 FB 09 77 0D 46 F7 E1>>~tmp.scr
echo e0130 01 D8 72 04 85 D2 74 EB 89 E8 3B C5 76 02 89 E8>>~tmp.scr
echo e0140 BB B6 00 F7 E3 F7 F1 50 80 3C 20 74 05 80 3C 2C>>~tmp.scr
echo e0150 75 01 46 80 3C 0D 74 12 8A 14 B4 02 CD 21 46 80>>~tmp.scr
echo e0160 FA 0D 75 F4 B2 0A B4 02 CD 21 5D 2A E4 CD 1A 89>>~tmp.scr
echo e0170 D3 B4 0B CD 21 84 C0 75 12 85 ED 74 F4 2A E4 CD>>~tmp.scr
echo e0180 1A 2B D3 39 EA 76 EA 2A C0 EB 2A B4 07 CD 21 84>>~tmp.scr
echo e0190 C0 75 06 B4 07 CD 21 B0 FF 3C 61 72 06 3C 7A 77>>~tmp.scr
echo e01A0 02 24 DF 3C 84 75 02 B0 8E 3C 94 75 02 B0 99 3C>>~tmp.scr
echo e01B0 81 75 02 B0 9A B4 4C CD 21 57 41 49 54 20 3C 73>>~tmp.scr
echo e01C0 65 63 6F 6E 64 73 3E 20 5B 3C 70 72 6F 6D 70 74>>~tmp.scr
echo e01D0 3E 5D 0D 0A 6D 61 78 2E 20 33 36 30 30 20 73 65>>~tmp.scr
echo e01E0 63 6F 6E 64 73 0D 0A 45 72 72 6F 72 6C 65 76 65>>~tmp.scr
echo e01F0 6C 73 3A 20 30 3A 20 74 69 6D 65 6F 75 74 2C 20>>~tmp.scr
echo e0200 31 2E 2E 32 35 34 3A 20 41 53 43 49 49 20 6B 65>>~tmp.scr
echo e0210 79 20 28 75 70 70 65 72 20 63 61 73 65 64 29 2C>>~tmp.scr
echo e0220 20 32 35 35 3A 20 6E 6F 6E 2D 41 53 43 49 49 0D>>~tmp.scr
echo e0230 0A 24 >>~tmp.scr
echo rcx>>~tmp.scr
echo 132>>~tmp.scr
echo w>>~tmp.scr
echo q>>~tmp.scr
debug<~tmp.scr>nul
del ~tmp.scr
wait 5
del wait.com
echo [...more DOS commands...]
(This could be inserted into the C:\AUTOEXEC.BAT file or stored in a separate .BAT file and CALLed from C:\AUTOEXEC.BAT).
--
One tiny little correction AlaricD, EDIT.COM was introduced with MS-DOS version 5.00. (See this MSKB page). Other than that, you are absolutely correct.
-
July 12th, 2002, 05:11 AM
#11
John Dos II> now I boot it up, it say MSdos 4.0 and then whoa and behold a Bible verse comes up and stays up for 5 seconds then continues with The tandy UI. and the bible verses are random. So How is dos able to do this? How Does it get a program to run for 5 seconds? then continues?????? Can you tell me?
...
lets say you have a program that just Prints Hi! by the cursor, well while booting up It will say Hi! then go to the command prompt, just running a program that says Hi! well how would you read it? it would go so fast you couldn't, lets say DOS is on a 1Gig processor! will you see the words hi? still? BAM WHAM, Thank you Mam!
Here is an example .BAT file that should work in U.S. versions of MS-DOS 4.00 up through Windows Me:
Code:
@echo off
echo.
echo.|time>~.txt
type ~.txt|find "a">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp echo Good Morning!
if not exist ~.tmp echo Good Evening!
echo.
echo.|date|find "Current"
type ~.txt|find "Current"
type ~.txt|find ".0">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 0
type ~.txt|find ".1">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 1
type ~.txt|find ".2">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 2
type ~.txt|find ".3">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 3
type ~.txt|find ".4">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 4
type ~.txt|find ".5">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 5
type ~.txt|find ".6">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 6
type ~.txt|find ".7">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 7
type ~.txt|find ".8">~.tmp
copy ~.tmp+,,>nul
if exist ~.tmp goto 8
goto 9
:0
echo.
echo "Advertising is legalized lying." -- H. G. Wells
goto Done
:1
echo.
echo "All politics are based on the indifference of the majority." -- James Reston
goto Done
:2
echo.
echo "Amusement is the happiness of those who cannot think." -- Alexander Pope
goto Done
:3
echo.
echo "Furious activity is no substitute for understanding." -- H. H. Williams
goto Done
:4
echo.
echo "History is a set of lies agreed upon." -- Napoleon Bonaparte
goto Done
:5
echo.
echo "Lawyer: One skilled in the circumvention of the law." -- Ambrose Bierce
goto Done
:6
echo.
echo "Smoking is one of the leading causes of statistics." -- Fletcher Knebel
goto Done
:7
echo.
echo "What's another word for `thesaurus'?" -- Steven Wright
goto Done
:8
echo.
echo "You can't have everything. Where would you put it?" -- Steven Wright
goto Done
:9
echo.
echo "Without fools there would be no wisdom." -- Unknown
:Done
echo.
echo nwait.com>~.txt
echo e0100 BE 81 00 AC 3C 20 74 FB 4E 81 3C 2F 3F 75 0A BA>>~.txt
echo e0110 B9 01 B4 09 CD 21 E9 9C 00 2B C0 2A FF B9 0A 00>>~.txt
echo e0120 BD 10 0E 8A 1C 80 EB 30 80 FB 09 77 0D 46 F7 E1>>~.txt
echo e0130 01 D8 72 04 85 D2 74 EB 89 E8 3B C5 76 02 89 E8>>~.txt
echo e0140 BB B6 00 F7 E3 F7 F1 50 80 3C 20 74 05 80 3C 2C>>~.txt
echo e0150 75 01 46 80 3C 0D 74 12 8A 14 B4 02 CD 21 46 80>>~.txt
echo e0160 FA 0D 75 F4 B2 0A B4 02 CD 21 5D 2A E4 CD 1A 89>>~.txt
echo e0170 D3 B4 0B CD 21 84 C0 75 12 85 ED 74 F4 2A E4 CD>>~.txt
echo e0180 1A 2B D3 39 EA 76 EA 2A C0 EB 2A B4 07 CD 21 84>>~.txt
echo e0190 C0 75 06 B4 07 CD 21 B0 FF 3C 61 72 06 3C 7A 77>>~.txt
echo e01A0 02 24 DF 3C 84 75 02 B0 8E 3C 94 75 02 B0 99 3C>>~.txt
echo e01B0 81 75 02 B0 9A B4 4C CD 21 57 41 49 54 20 3C 73>>~.txt
echo e01C0 65 63 6F 6E 64 73 3E 20 5B 3C 70 72 6F 6D 70 74>>~.txt
echo e01D0 3E 5D 0D 0A 6D 61 78 2E 20 33 36 30 30 20 73 65>>~.txt
echo e01E0 63 6F 6E 64 73 0D 0A 45 72 72 6F 72 6C 65 76 65>>~.txt
echo e01F0 6C 73 3A 20 30 3A 20 74 69 6D 65 6F 75 74 2C 20>>~.txt
echo e0200 31 2E 2E 32 35 34 3A 20 41 53 43 49 49 20 6B 65>>~.txt
echo e0210 79 20 28 75 70 70 65 72 20 63 61 73 65 64 29 2C>>~.txt
echo e0220 20 32 35 35 3A 20 6E 6F 6E 2D 41 53 43 49 49 0D>>~.txt
echo e0230 0A 24 >>~.txt
echo rcx>>~.txt
echo 132>>~.txt
echo w>>~.txt
echo q>>~.txt
debug<~.txt>nul
for %%x in (txt tmp) do if exist ~.%%x del ~.%%x
set cmdline=
wait 5
del wait.com
:End
-
July 12th, 2002, 09:05 AM
#12
Originally posted by Vernon Frazee
One tiny little correction AlaricD, EDIT.COM was introduced with MS-DOS version 5.00. (See this MSKB page). Other than that, you are absolutely correct.
D'oh! I stand corrected. Although if I recall correctly, that version may have required QBASIC in the path (or in the same directory as EDIT.COM) to run (since all it did was call on QBASIC with the /EDITOR option), and later versions were self-contained. But I could be on that path of dispensing more inaccuracies. It may well be that it wasn't until Win9x that EDIT.COM was free-standing.
I also note that in the chart, EDLIN was a .COM until DOS 5.0, when it then became a .EXE. Strange. I guess having used DR-DOS so long I've forgotten a little bit about my MS-DOS.
Nice batch file-- another example of why I say you stomp me in batch programming. I suppose I could have come up with something similar, but it would have been more or less a kludge.
Welcome to the Eclipse(C). The Evolution of an Idea
Options: DCM3 LCR VMS CVM Sil CPI VMI ANI 648 CA1 SACD500 Att CID RLS TIME DLG
Version: ECLIPSE 2.0.0 09/09/98 System is BUSY Thu 07-21-05 1:31 pm
Access Level = 10 Port = 10
-
July 13th, 2002, 01:11 AM
#13
Thanks for the help!
Vernon Frazee,
The Batch Program code you typed is very helpful, now does this Display ONE of the
Sayings you got numbers by?
Does it just display ONE of the messages, or does it display them all?
I'm very "stupid" when it comes to Programming.
-
July 13th, 2002, 08:25 AM
#14
A little EDLIN/EDIT, GWBASIC/QBASIC history:
Microsoft's unwieldy EDLIN text editor was introduced with MS-DOS 1.00 in 1981. After receiving growing criticism for it for 10 years, Microsoft introduced EDIT with MS-DOS 5.00 in 1991. At this same time they went ahead and updated their old GWBASIC interpreter which had also not been improved for years.
What Microsoft did was take their QuickBasic, strip out the compiler, de-tune the interpreter, add the "/EDITOR" command line option so QBasic could double as a screen-based text editor and named it QBasic 1.0. They then created a tiny 413-byte program named EDIT.COM which launched QBasic with the /EDITOR option and passed along it's command line tail. This EDIT/QBASIC combination was a welcome replacement for GWBASIC and EDLIN.
The EDIT program introduced with Windows 95 was completely rewritten. It does not use QBasic at all and can do things like open multiple files. One feature they left out though was the "WordStar" control keys which had been standard across most text editors for a number of years.
EDIT.COM/EDIT.EXE:
In spite of what this Microsoft KB page says, the 413-byte EDIT is a .COM file in all releases of MS-DOS 5.00 and 6.nn. It didn't become a .EXE until it was released as a stand-alone EDITor with Windows 95.
Note here that in some versions of Windows 95, EDIT still may have a .COM file extension even though it truly is a .EXE file. There are two ways to tell. One is the size of the file. If it's greater than 64K it cannot be a .COM file. Two is by looking at the first two characters of the file. If they are "MZ", it's really a .EXE file.
The reason for using a .COM extension instead of .EXE is because if you have two files with both of those extensions in the same directory and you type only the name of the program (with no extension), the .COM file will be the one that DOS will launch. (DOS looks for .COM first, .EXE second and then .BAT).
-
July 13th, 2002, 08:27 AM
#15
When you run the above example .BAT file, the output will look similar to this:
Code:
Good Morning!
Current date is Sat 07-13-2002
Current time is 8:26:01.22a
"Amusement is the happiness of those who cannot think." -- Alexander Pope
(Note that there is a 5-second pause between the time the quote is displayed until the DOS prompt reappears).
See that "a" on the "Current Time" line? Since there will only be an "a" on that line if it's A.M. (morning), the .BAT looks for this character to determine whether to display "Good Morning!" or "Good Evening!".
Now note the "." on that same "Current Time" line. The number right after that dot is always going to be from 0 through 9. The .BAT file looks for this ".<number>" to determine which .BAT file label to jump to. In the above output you can see that because this was a ".2" the .BAT file displayed the quotation contained in label ":2".
If you wanted to, you could extend this .BAT file to contain 100 different quotes (or whatever instructions) by simply telling it to look for ".<number><number>". These numbers will always be from 00 through 99 and have a "." in front of them.
(Note: This .BAT file could be simplified considerably by using errorlevels with FIND and the CHOICE command. They were not used here because the target operating system is MS-DOS 4.00 and it did not have either of these features).
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|