Envy, BPL, and Run & Hide

I had been spending some time in the Usenet groups comp.os.msdos.batch and comp.os.msdos.batch.nt. Those were fun groups. Participants in those groups were usually talking about writing batch files to perform various kinds of tasks. The people that frequented these groups were usually MS-DOS/Windows systems administrators. They were a target audience for the tools I had built so far.

I had noticed how complex some of the tasks some of them needed to write and maintain were. Sometimes the solutions were straightforward. Other times, the solutions worked with no external utilities, but the code to accomplish these tasks could be a little arcane.


I had written a number of personal utilities that modified either a given process' parent environment block or the master environment block using a number of schemes to locate this area of memory. The environment block was a section of memory that held the MS-DOS environment variables for a given process. I had pondered a utility that would provide some straightforward programming commands that would leave their results in the specified environment variable in the parent environment block. I quit pondering and I implemented ENVY, a 16-bit program for MS-DOS.

ENVY option
Where option can be one of the following:

-checkenv number
-checkmax number
-compare num op num
-copy var srcvar
-ctime var
-date var
-dec var
-deletevar var
-eko str1 .. strN
-expr var term operator term
-filename var [drive path basename ext ] filenameandpath
-findinpath filename
-getdir var
-getxy varx vary
-gotoxy numberX numberY
-inc var
-index var str srchstr
-key var
-lcase var str
-length var str
-loadenv filename
-match str srchstr
-random var max+1
-readln var
-replace var str chr1 chr2
-saveenv filename
-seterrorlevel number
-sleep seconds
-sprintf var str1 .. strN
-substr var str start length
-time var
-ucase var str
-word var num str
-wordcount var str
-write var filename
-writeln var filename

ENVY added 37 new utility functions for batch file developers. Many of those functions that returned one or more results, left the results in an environment variable. With ENVY, one could write a batch file that might look something like this:

@echo off
set x=1
echo x is %x%
envy -inc x
envy -compare %x% gt 10
: if x isn't greater than 10, goto loop.
if errorlevel 1 goto loop

The above script should print ten lines saying “x is” followed by the value of x.

I sold a few copies of ENVY. I made the choice to quit selling it after having to deal with a few support issues where people were trying to use it with the Windows NT cmd.exe interpreter. Hint: It wasn’t supposed to work with MS-DOS’s command.com.


While I gave up on ENVY, I hadn’t given up on the idea of a supplement for batch scripts. I wrote a simple interpreter for a one-operation-per-line language that I called BPL … “Batch Programming Language.” BPL was an interpreter whose scripts looked sort of like batch files. Here’s an example BPL script that demonstrates BPL’s math capabilities:

echo "Math demo"

set a 2
set b 5

add c $a $b
echo $a " plus " $b " equals " $c

sub c $a $b
echo $a " minus " $b " equals " $c

mul c $a $b
echo $a " times " $b " equals " $c

div c $a $b
echo $a " divided by " $b " equals " $c

mod c $a $b
echo "The remainder of " $a " divided by " $b " is " $c

and c $a $b
echo $a " and " $b " is " $c

or c $a $b
echo $a " or " $b " is " $c

xor c $a $b
echo $a " exclusive-or " $b " is " $c


…which yields the output

Math demo

2 plus 5 equals 7
2 minus 5 equals -3
2 times 5 equals 10
2 divided by 5 equals 0
The remainder of 2 divided by 5 is 2
2 and 5 is 0
2 or 5 is 7
2 exclusive-or 5 is 7

Press ENTER to continue...

A fellow named Tom registered some copies of BPL and then he emailed me. Tom used to write various kinds of business software using a PC-based COBOL compiler. He used BPL for all of the administrative tasks around that software … using it to choreograph scheduled executions and such. He loved it. In fact, I believe that he was the one who talked me into implementing a while-loop and another feature or two to help deter “spaghetti code” that can often plague languages that are dependent on a GOTO verb for flow-control.

Other than those few who registered the product, BPL did not really seem to resonate with most folks. I was competing with any number of automation languages. The niche that I tried to cover was syntactic simplicity when compared to the other offerings. I had mentioned writing a BPL compiler so that one could package up BPL scripts into a single distributable EXE, but I didn’t pursue that. I still wonder if I should have built the compiler.

I stopped selling BPL because the sales just weren’t there. It wasn’t really taking off.

Run & Hide

Run & Hide was a utility that would run a command in a hidden console window. I’d heard some folks mention that people were hitting CTRL-BREAK during some batch startup scripts, which caused a few problems. I thought that this might be a common problem that Windows sysadmins might’ve been facing.

I ended up selling around twenty copies before I pulled the plug on it. There were some Windows Scripting Hosts scripts making the rounds in the newsgroups that provided the same function.


I should note that all three of the above products were written in C. ENVY was written using a 16-bit C compiler.

Three more products that ended up not doing well. I had an idea for another product which fared better than all of these products combined. I’ll talk about that one soon.