home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
UTILS1
/
DOSVER.ZIP
/
DOSVER.TXT
< prev
next >
Wrap
Text File
|
1994-02-10
|
6KB
|
119 lines
┌──────────────
│ DOSVER.TXT █
▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
Thu 02-10-1994 10:30:10
┌──────────────────────────────────────────────────────────────────
│ DOSVER.BAS █
│ █
│ WARNING WARNING WARNING █
│ ──────────────────────────────────────────────────────────────── █
│ █
│ Do =NOT= run DOSVER.BAS inside the QuickBASIC █
│ Environment or you will be very, very sorry. █
│ █
│ The command that sets the ERRORLEVEL also will close █
│ QuickBASIC, start your printer, and overwrite your ROM! █
│ █
│ It also will probably lock your front door, step on your █
│ cat's tail -and- hide all your matching argyle socks! █
│ █
│ SO DON'T DO IT!!! █
│ █
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
Well.... Hi there... Yep, I'm still playing with Assembly and
having a high old time. Have been rebooting my computer about once
an hour for several days now.... lot'sa fun, lot'sa fun....
As a matter of fact code for rebooting computers looks like my next
project. Would you believe a -2- byte (Microsoft recommended, but
only works in some computers) program that reboots your computer?
Or a 5 byte program that seems to cold boot -all- computers? Or the
pie`ce de re'sistance a "HUGE" 30 byte program that resets your
SMARTDRV.EXE (so it writes it cache to your disk files) then yells
"Yoo hoo!" to your EMM386.EXE so -it- shuts down, then =warm boots=
your machine???!!!!
I'm sure you remember when DOS 6.0 first came out and some big
smart companies back East were yelling that DBLSPACE.EXE didn't
work and was corrupting files. Well they shut up after grousing
about it for months while printing bad news about a good program,
DBLSPACE.EXE.
What you probably -don't- know is that it wasn't DBLSPACE.EXE that
was the problem. Nope, it was some software they were using to
reboot that didn't permit SMARTDRV.EXE to write its cache to disk.
I believe that they didn't set the ALTBOOT switch on EMM386.EXE,
either... as that would give them grief if they used Ctrl+Alt+Del
to reboot but not sure.
No... didn't think you heard them apologize, never hear the
retractions, just the alarming stuff seems to sink in. So a "smart"
warm boot program is a good idea, and that's what I'm working on.
But that's next week's project.
Let's talk about "getting small."
Can see how those PC Magazine programmer meowers who wrote all those
tiny *.COM "DOS Utility Programs" in the late '80s got hooked on
this stuff.
You know those *.COM programs don't you? Hundreds of eight to a few
hundred byte programs that they -still- give out for renewing your
magazine subscription. Little *.COM files that don't tell you what
they do.... sometimes load as TSRs and lock your keyboard and
almost always require a five pound reference book to explain
them....
You know those don't you? "Getting small" as far as the final file
size in programming is an obsession... probably a dumb one in this
day and age of the gigabyte hard drive for home and small business
Windows programs.
Anyways... found I needed a batch file to sense what Version DOS
some of these little assembly programs need in order not to lock
the keyboard and cause you (and me) endless irritation. Found I
could write (copy) an assembly program to get the DOS Version, but
just didn't know how to print that text to the screen. I'm sure
it's "easy" if you know how.... Since I really, really dislike
(hate) little programs which have no internal help instructions
like the ones described above.... had to make a better DOS Version
mouse trap.
I was sitting here wondering how to do that while reading from the
four or five volumes of hieroglyphics that are laughingly called
"Assembly Programming" when a thunderbolt of thought hit.
"Why not do it in QuickBASIC 4.5!"
So that's what I did. It's well known that "you can't" end a
QuickBASIC 4.5 program with an Exit Code (aka a Return Code or
ERRORLEVEL number). But for you denizens of the deep who have been
following this unfolding drama... you -know- that I found the
secret to make such a QuickBASIC 4.5 program a couple of weeks ago.
So made DOSVER.COM, a QuickBASIC 4.5 program and this batch file
to get an ERRORLEVEL of the DOS Version. Since we can only get an
ERRORLEVEL from 0 to 255, only gets the "Major" portion of the DOS
Version. If the DOS Version is 6.2, all you get is the six (6). But
since I didn't want to mislead anyone what it prints to the screen
is:
──────────────────────────────────────────────────────────────────
DOS Version < 6.x >
──────────────────────────────────────────────────────────────────
If you just run DOSVER.COM, it prints the DOS Version to the
screen... Ah... just what I wanted...
Oh... sorry have to go... have to reboot the computer again...
Bye...
John De Palma on CompuServe 76076,571