Tech Pranks from the MS-DOS 16-bit Era

In the late 1980’s and early 1990’s I worked as a C and 80×86 assembly language programmer in MS-DOS and 16-bit Windows environments. I liked to tinker at a rather low level. I became proficient in writing DOS device-drivers, memory-resident Terminate  but Stay Resident (TSR) applications, and applications that used largely undocumented internal API’s and system services.

While we had to log in to our local area network, our physical machines weren’t locked down. It wasn’t unusual for my team to play pranks on one another. I liked to play pranks that involved arcane knowledge of the system.

Many of my early pranks were dependent on TSR’s that I would install on coworkers’ machines. These were normally the sort of things that provided applications that seemed to multitask with whatever your current MS-DOS application happened to be. ( On-screen clocks, screen-savers, security programs, …etc. )

Cursory Glance

One of my more memorable DOS pranks was one that I pulled on my coworker who we called “Chewie.”

I was toying with some system routines that control the size and thickness of the DOS cursor and I got an idea for a prank. I wrote a little program and ran it on Chewie’s machine while he was away from his desk. I’d found that for a flat line cursor, one could tell the BIOS one of several miniature rows in which to place the cursor. So, you could have a flat cursor that appeared right at the middle of the letter to the left … that sort of thing.

I wrote a TSR that placed the flat cursor at the top of the space used by a single character and then every half-second or so, I would move it down one more pixel until it had reached the bottom. Then, I would start it at the top, again. It looked something like this:

Chewie had known me to play pranks on folks, so he immediately stopped over in my row of software developers and asked what I had done. I played it cool. “What do you mean?”

He smiled and led me over to his cube. I had been talking to my coworker, Dave, who I had let in on the gag. Dave followed me over, too.

Chewie showed us the unruly cursor.

“Wow!” I said. “Chewie, I think your cursor is broken.”

Chewie still thought that I was up to something, but neither Dave nor I broke a smile. Dave said, “Ah, man. That happened to me on my last machine. What a pain.”

Chewie’s smile started to flatten. “You’re just going to have to put up with it until you can get a new one,” I told Chewie.

I then directed him over to the area where our desktop PC support personnel worked. I told him he had to go have Mike order him a new cursor. He chuckled for a minute, but again … Dave and I stood there stone-faced.

Dave added, “It’s an approved expense. It doesn’t happen very often, and they’re cheap enough.”

Chewie then knowingly said “Right,” and marched over to talk to Mike.

As he got to Mike’s cube, he turned to ask Dave and me one more question … and found us doubled over trying not to make noise as we were laughing. He smiled and said “You guys!”

By the Numbers

My pal, Bob, used to disable the Num Lock key so that he could use the cursor keys on his numeric keypad. Workers from other areas would often try out code changes that Bob made on his machine. Sometimes, they would re-enable Num Lock and would neglect to turn it back off. Bob would complain about the situation if they would forget, as he’d try to navigate in a text editor and would end up typing a few digits, instead.

I wrote a TSR that would change the shift-state so that Num Lock would re-enable itself every 20 seconds or so. If I remember correctly, one just had to set the proper bits in 0040:0017 in the BIOS Data Area. (If I’m reading old documentation correctly, I think I just had to OR the byte with 20h. )

I ran this on Bob’s machine while he was away. I also loaded a string that said “Hi, Bob!” into the command tail area in the Program Segment Prefix (PSP) of my TSR. I did this because we often used a utility called MAPMEM which would list the MCB (Memory Control Block) chain, including TSR’s. The values in PSP:081h and up were displayed if the MCB was a PSP. I just wanted MAPMEM to display “Hi, Bob!” if he ran the utility.

Bob resumed working on his machine. I sat in a cubicle next to him, so I heard a bit of key-thumping. I assume that he shut off the Num Lock. In a short while, I could tell that it had turned back on. Without doing anything else (and without running MAPMEM ) Bob just yelled “Jiiiiimmm!!”

I don’t know how he knew it was me.

Making a List

One of my next pranks wasn’t that technical, except that I leveraged the “hidden” file attribute to pull it off. I wrote a C program that used the dos_findfirst() and dos_findnext() functions to iterate through the filenames in the current directory. I then displayed a line on the console for each non-subdirectory file saying “Deleting: ” followed by the filename. If you ran the program, it appeared to be deleting everything out of the current directory.

My team lead, Mark, had asked us to write up some ideas in a text file for something or other. He asked us to place those text files in a folder on a common directory on our network. I did. I noticed that he had a lot of files in that folder. I placed my new “Deleting:” program in that folder as LIST.EXE. I then set the hidden attribute so that it couldn’t be seen. I told Mark that I left my list of ideas in the common folder. In order to goad him into looking at it, I acted like some of my ideas might be kind of off-kilter.

We normally used Vern Buerg’s LIST.COM utility to view files. When Mark would have looked at my text file entry, he would have typed:

LIST jimsfile.txt

That command would normally have picked up LIST.COM in a common directory in the PATH. However, since I had placed a file named LIST.EXE in the same folder, that one took precedence and executed, even though it was hidden. Mark soon saw a list on the screen that indicated that all of his files were being deleted. He had no time to shut if off. He was elated that when he listed the directory, everything was intact.

Mark knew I was behind it. As his blood-pressure dropped back to normal, I explained to him how I did it.

Crazy Like a Fox

When Windows 3.1 came along, new opportunities for mischief came with it. We were soon changing each others’ background images and such. When we started to get speakers on our PC’s, we would put WAVE files in each others’ startup processes and we’d crank the speaker volume up.

I was reading in some volumes of Andrew Schulman’s Undocumented DOS and Undocumented Windows books of a technique that allowed a DOS program to add to the list of EXE’s and DLL’s to be loaded at by Windows 3.1 when the “WIN” command was executed. I wrote about this technique in the November 1994 issue of Windows/DOS Developer’s Journal.

I wrote a program to copy a BMP file of the FoxPro logo to a local folder. The program then set the Windows wallpaper to refer to the FoxPro logo in a tiled fashion so the background was full of little cartoon fox-heads. This program repeated the process every minute or so. I was going to use this to play a prank on my coworker, Paul, who was very vocal about not liking the FoxPro xBase product. It was Paul’s last day as he’d gotten a gig in another state, so I felt he was a good target.

I was going to use the feature I’d mentioned before to add my EXE to the list of EXE’s to be run when WIN was executed.  I wrote a small machine code .COM file using DEBUG to call the proper interrupt to set the EXE name.

I then used a technique that I’d been toying with. I renamed the .COM file so that the prefix was the character 0xff. You could enter this character by holding down the ALT key and hitting the digits 2,5, and 5 (ALT-255) from the numeric keypad. If you executed a directory listing, the .COM file would show up with what appeared to be a space or a blank prefix.

I then entered a new line into Pauls’ AUTOEXEC.BAT file … his startup script. It was one line that had the character 0xff / ALT-255 in it. It looked like a blank line, but the system would look for .COM, .EXE, and .BAT files with the invisible prefix character.

Paul fired up his machine and went into Windows. The FoxPro logo showed up in his wallpaper. He laughed and then reset it. Then, as he later recounted the situation, watched in horror as the logo reappeared. He tore apart his AUTOEXEC.BAT and a series of INI files, but he could not figure out how this was happening.

Web browsers, TCP networking, and many other items in the evolution of technology opened up other avenues for my pranks. Those stories are for another day.


About Jim Lawless

I've been programming computers for about 37 years ... 31 of that professionally. I've been a teacher, I've worked as a consultant, and have written articles here and there for publications like Dr. Dobbs Journal, The C/C++ Users Journal, Nuts and Volts, and others.
This entry was posted in Programming and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s