Hate UML?

Draw sequence diagrams in seconds.

How QBASIC almost got me killed
Posted on: 2009-07-30 08:00:00

Back in high school, I had too much free time, so I decided to play a joke on my computer teacher. I created an exact clone of the school's DOS system using QBasic. It would pretend to execute three commands: DIR, DEL *.*, and FORMAT. The simulation was so realistic that during development, I was kicked out of the lab. Usually students would be playing Secret Agent or Jill of the Jungle.

The day arrived when my project was ready to be unleashed upon the world. I waited until the teacher was hovering nearby and then I started my application, running the FORMAT command on the network drive. Some classmates were watching the screen and she hurried over to see what all the fuss was about.

DOS screen formatting a disk

The reaction was immediate. She stared at the screen, eyes wide open, and mouth agape, as the terrible seconds ticked by. At that moment I regretted my deception and tried to abort the demo. But QBasic didn't understand CTRL-C during the SLEEP command. Pressing CTRL-C just interrupted the current SLEEP, so it caused the percentage to advance faster. I had to hold down the abort keys and wait until it advanced to 100% before I could prove that everything was really okay.

But then it said:

Unable to read from drive X:
Abort, Retry, Fail? _

That was the closest I've ever come to being murdered.

Want more programming tech talk?
Add to Circles on Google Plus
Subscribe to posts

Post comment

Real Name:
Your Email (Not displayed):

Text only. No HTML. If you write "http:" your message will be ignored.
Choose an edit password if you want to be able to edit or delete your comment later.
Editing Password (Optional):


2009-07-30 10:28:34
Wait, so... You said you created an exact clone. Does that mean you created the "unable to read from drive X:" error at the end? Or do you mean that you actually ran a real DOS prompt by mistake?


2009-07-30 11:25:50
I had the same question,



2009-07-30 11:27:35
It should have said "Cannot format a network drive."

Steve Hanov

2009-07-30 11:46:51
The "unable to read from drive X:" prompt was actually simulated by the program as well. So no worries!


2009-07-30 12:21:17
I once wrote a one line CP/M emulator for our PDP11. No matter what you typed it just said 'BDOS ERROR ON A:'



2009-07-30 12:38:57
You should have pressed CTRL+Pause instead of CTRL+C.


2009-07-30 14:05:38
I did the same thing (in Pascal) back in high school. My app initially showed a generic error message and every Y/N or Abort/Retry/Fail response you made would eventually lead you to a fake disk format. I never ran it at school but did get my Dad with it.

me too

2009-07-30 14:11:03
I created a QBasic program that was an exact replica of the school's ASCII login screen. It would get the password, store it on the network drive, prompt an error message for about 1 second about a token ring malfunction, then restart the computer. I only used it on a couple of friends just to screw with them.....ah, good times.


2009-07-30 14:28:26
I once created a gui to track an ip address with qbasic.


2009-07-30 14:32:24
In high school, I was party to a VMS/VAX command line simulation written in DCL; I wasn't the original author, but I tweaked it and deployed it on a few VAX terminals in the computer science lab.

The purpose of the program was to simulate the login prompt, record entered login credentials in a flat file, spit out an "incorrect login" error, and drop the user to the real login prompt transparently.

One of the difficulties was that DCL had no "clear screen" command like DOS, so we got around it by launching and immediately terminating the built-in "phone" application (which allowed you to have a split-screen chat with another luser on the system).

Though there was an extremely momentary flicker of a line across the screen (the split screen divider), nobody was ever the wiser.

Eventually our CS teacher discovered the app, searched the entire VAX for it (by name) and suspended all of the accounts he found it in!

Those were good times.


2009-07-30 14:59:45
I did something like this during my junior high years...I learned this from my Step-Dad, who was a programmer. The difference is that I memorized some command lines and did it to the main computer in the computer lab...and BAMM...all computers down...oops.


2009-07-30 17:04:45
I did the same thing in Pascal in High School, great fun especially when I made it TSR.

James Andrix

2009-07-30 18:54:37
Kudos for a legitimate and proper use of the blink tag.

Michael Mol

2009-07-30 23:01:59
That's beautiful.

When I was a kid (10 years old or so), I came across a program called LOVEDOS.

LOVEDOS gave every impression of being the normal DOS shell, except that the directories shown by "dir" clearly weren't your own, the files clearly weren't your own—And the computer was coming on to you, in various subtle and not-so-subtle ways. The only way to exit the program was to type "I love you" at c:\>

I put it in my step-dad's autoexec.bat.


2009-07-31 00:01:19
That was really cool. Reminds me of my college days where we were thrown out for creating a website for out department :P :P


2009-07-31 01:13:03
As far as I remember, it understands Ctrl+Break to jump back into debugging.


2009-07-31 02:01:33
ah, great times. it almost counted as a "sport" to write alt+255 programs at my school.

so, alt+255 is an invisible, space-like character, but the great thing is, you could name files/scripts alt+255.exe/bat. and if you put them in c:\, you could add them to the autoexec.bat without one noticing it.

i used this to write a mockup virus scanner, that reported a virus (tequila!), then faked a system error and begann formatting. additionally, it set the dir command to search for andiasjd.sdj files by default, so if you just wrote "dir" afterwards, the response was "no files found".

my younger cousin (always my first victim, uh, beta tester then) began to cry. i still feel bad for this.

uh, and i especially love my mockup format:

"really format drive c? all data will be lost! (y/n)"

user types "n"

"warning: are you really sure you want to delete all data on drive c:? (y/n)"

user types "n"

"formatting drive c:"

"format 1% ..."

the look on their face ...!


2009-07-31 05:34:12
I was terrible in high school. I figured out how to remotely raise BASIC errors, so I'd sit at the back of the computer room and send errors to people who were working on their programs. I'd use ridiculous phrases for errors, like "Incorrect number found" or "Text too short" or "Upper case E not valid at this location", and they'd be like "WTF, I never heard of that error! There isn't even an upper case E on that line!" (the error would break their program on whatever line happened to be executing at the time). Ahh, good times.


2009-07-31 08:14:02

I smell BS. Examples or it didn't happen.


2009-07-31 09:57:40
Do you want to play a game? How about Global Thermonuclear War?


2009-08-03 07:46:21

The beauty of remote code exploits is that you can potentially use them to do anything.

Our school had a network of Acorn BBC computers that had a ROM for networking, called "Econet". The Econet ROM had built-in routines for copying blocks of data to or from an arbitrary memory location on a another computer and another for remotely executing a JSR instruction to an arbitrary memory location.

In my more constructive moments, I started working on a system that would allow a program to use the the memory of any number of computers on the network. But I never finished it.

Brent Ashley

2010-01-10 20:18:35
In the early 90s I worked as a computer tech at Ontario Provincial Police headquarters, which was in downtown Toronto at that time.

OMPPAC (Ontario Municipal and Provincial Police Automation Cooperative) was rolled out during my tenure. It ran on XT-class PCs connected via token ring to communication servers and then to the tandem via 9600 baud async connections. It was a character-based application with an opening screen that spelled out OMPPAC diagonally across the screen in large letters composed of each character, and a bitmapped OPP symbol.

I wrote a QB4 program in 1989 or so that mimiced this screen in graphics mode. As soon as you hit a key, a pacman character appeared at the top left and started munching the screen up a row at a time, with pc speaker "Jaws" music. When it reached the end, the screen flashed postitve/negative a few times and then was overwritten with OMPPAC-MAN!!!, with accompanying musical "CCEG.EG!!" fanfare.

I installed this on the demonstration machine just before a meeting of some of the top brass, superintendents and inspectors. I subsequently discovered that this is a group of people particularly immune to humour.

Luckily for me as a civilian employee at the time the fallout was not significant, but there were a lot of red faces and blustering, sputtering rage from those accustomed to barking orders and not getting egg on their faces.


2010-01-13 11:34:39
I did the same thing in high school except I made it appear I had hacked into the FBI's mainframe...and the authorities had traced the signal....and the teacher believed it.


2010-01-19 17:35:15
Since everyone's telling old stories, in school a long time ago I made a DOS memory resident program that took over INT13 and ignored all disk write commands but passed through all read commands. And SmartDrive would cache all write commands thinking they worked.

The result was you could delete a file and it would appear to be lost if you entered "DIR", in real DOS, until smartdrive flushed it's cache or you rebooted the machine.

You could also run the actual FORMAT command, running for real, but the disk data would be intact afterwards.

Great times, great fun!


2010-01-26 03:56:14
Back in college, a guy copied my QBasic program without permission.

So i wrote a QBasic fake. Once he typed QBasic at the command prompt, the program told him to insert his floppy disk, and when he inserted it, the program did a DIR on his floppy disk, and deleted my program if it found the filename.

The guy looked at me like someone from another planet henceforth...lol

Nuri Hodges

2010-01-27 01:45:06
I beta tested Jill of the Jungle. :D


2010-03-19 15:31:37
Damn, I did not realize so many people have done similar things using QBasic.

I did something similar, but the reason was different. We were using PS/2 machines as dumb terminals to connect to a terribly underpowered IBM RS6000 unix server where our source code, compilers, etc... were stored. Having to use VI to edit code on a machine with not enough memory was ok when only one or two students were connected, but as soon as the 15 of us were connected and compiling, it become a nightmare to edit and save. Easy solution: Run something like the Turbo Pascal editor to edit the Cobol sources, then copy to the unix server, launch the compilation and continue to edit the source code on the PC while it compiles.

Except we were not allowed to save anything on the PC at all, and we were forbidden to bring any floppies. My solution was to reprogram fake dos commands (like DIR and CD) using compiled QBasic, calling the real DIR command (patched to DYR in CMD.EXE) and filter the output to hide the location of a hidden folder deep in the IBM AIX software. I installed that one evening when the teacher was sick, and I've been able to use Turbo Pascal and other cool tools and games (to play while things compiled) for two years in a row :)

Funny thing is that I was storing the output of all commands in a log file, so I was able to see what people were typing on the computer, allowing me to see exactly how the teacher was looking for unauthorized software. One day I noticed that there was a lot of strange command, and remembered that the day before IBM people came to "upgrade the AIX version", I quickly found out they also were looking for unauthorized installations of IBM software, and based on the time stamp they spent about 3/4 of their (expensively billed) time doing that...

Damn, too long a post...


2010-09-30 13:02:18
Okay..that was dam funny

Dwayne L

2011-06-26 17:22:33
Heh. X:COURSES... You guys had IBM ICLAS too? :)


2011-06-29 03:17:24
I did something similar with Visual Basic. It was a small popup that said something along the lines of "Are you sure you want to delete all files in C:Windows". The victim (my grandpa) naturally went for the cancel button but then the mouse would wig out and go straight for the OK button. I thought it was pretty funny to watch him yank the power cord from the wall in a panic as the progress bar worked it's magic. He didn't think that the two hours of work he lost in the prank was very funny and now I know just how volatile my grandpa's temper is.

Jeff Geurts

2011-08-15 13:20:35
Fun times! I did something similar in grade 11 to capture a user's password ... since my teacher assured me that if I could edit my grade to be 100%, she would let me keep the grade. My "program" emulated the login screen and continually gave the invalid username / password error, piping the entered username/pwd to a file on the network. But when I tested it on a fellow classmate, she freaked out and the teacher came over just in time to see me Ctrl-C : /

Michael Tiel

2012-02-03 23:20:33
this is sooooo epic!!! haha reminds me of my teen years, i sort of did the same thing, recreating a dos shell in QBASIC. I named it ' kut-dos' which is dutch for 'cunt-dos' and auto-runned it on every computer in the school lol, they couldn't do anything without my password. It actually wrote a .bat script that rewrote the autoexec.bat after running the command (but not before the user typed the dutch equivalent to 'i give praise to Michael' :D

Got me sent to the dean and almost kicked out of school lol! Haha good times with QBASIC :D


2012-12-16 15:27:34
No need for all this. Just prompt C:$gformat c:


2012-12-17 15:55:17
I friend of mine stayed home from highschool one day (this was in '96, the days when a network printer driver could crash NT 4) and I was chatting with him via IRC while in the computer lab. Each computer had sequentially assigned public IP address. He asked me what my IP address was, after I told him, he said "look to your left". The 6 desktops all flashed a blur screen of death. Then he said, "now to the right". Again 6 workstations (the computers where all against the wall in a big U shape, the teacher was included in that IP address assignment scheme and I was sitting 5 seats away from her. I remember begging my friend to crash my computer. The sight of half the classroom with blue screens while I'm doing fine. I laugh about it now but man at the time I was so scared I would get blamed for it. Good times thouse 90's :)


2013-10-31 15:42:00
During a maths exam when I was at school, we had these graphical calculators, and before the exam the teacher would come past and make sure we all cleared the memory, so we couldnĀ“t store equation solutions and what not.

It had a simple form of basic, so I wrote an program that emulated the clear memory function. It worked like a charm, the teacher never suspected anything.

Still failed the exam though.

Warren Reed

2014-01-14 19:08:27
OMG. I did this same thing back when I was about 20... I had a friend that was very anal about his files on this PC... he wouldn't even let the machine boot into windows - he always had to start it manually - so I built a similar DOS emulation - complete with line buffer so edits were done in the program - and after running a random number of DOS commands via passthru, it would fake the format, reading a text file on the drive to make the light blink with each percentage, and once formatted it would intercept all commands and either give the file not found or for DIR commands, it gave a fake empty structure with the appropriate size in bytes for the drive. He freaked out and was ready to jump on me until I told him to just hit ctrl-c, and then he still was so angry he didn't talk to me for days... but the reaction was priceless nonetheless... Thanks for sharing this and letting me relive those glory days again lol


2014-02-12 02:17:23
He made a program that LOOKED like a command prompt, and another

program that LOOKED like format. Not really format, or command prompt.

Pretty cool prank tho.


Other posts by Steve

Yes, You Absolutely Might Possibly Need an EIN to Sell Software to the US How Asana Breaks the Rules About Per-Seat Pricing 5 Ways PowToon Made Me Want to Buy Their Software How I run my business selling software to Americans 0, 1, Many, a Zillion Give your Commodore 64 new life with an SD card reader 20 lines of code that will beat A/B testing every time [comic] Appreciation of xkcd comics vs. technical ability VP trees: A data structure for finding stuff fast Why you should go to the Business of Software Conference Next Year Four ways of handling asynchronous operations in node.js Type-checked CoffeeScript with jzbuild Zero load time file formats Finding the top K items in a list efficiently An instant rhyming dictionary for any web site Succinct Data Structures: Cramming 80,000 words into a Javascript file. Throw away the keys: Easy, Minimal Perfect Hashing Why don't web browsers do this? Fun with Colour Difference Compressing dictionaries with a DAWG Fast and Easy Levenshtein distance using a Trie The Curious Complexity of Being Turned On Cross-domain communication the HTML5 way Five essential steps to prepare for your next programming interview Minimal usable Ubuntu with one command Finding awesome developers in programming interviews Compress your JSON with automatic type extraction JZBUILD - An Easy Javascript Build System Pssst! Want to stream your videos to your iPod? "This is stupid. Your program doesn't work," my wife told me The simple and obvious way to walk through a graph Asking users for steps to reproduce bugs, and other dumb ideas Creating portable binaries on Linux Bending over: How to sell your software to large companies Regular Expression Matching can be Ugly and Slow C++: A language for next generation web apps qb.js: An implementation of QBASIC in Javascript Zwibbler: A simple drawing program using Javascript and Canvas You don't need a project/solution to use the VC++ debugger Boring Date (comic) barcamp (comic) How IE <canvas> tag emulation works I didn't know you could mix and match (comic) Sign here (comic) It's a dirty job... (comic) The PenIsland Problem: Text-to-speech for domain names Pitching to VCs #2 (comic) Building a better rhyming dictionary Does Android team with eccentric geeks? (comic) Comment spam defeated at last Pitching to VCs (comic) How QBASIC almost got me killed Blame the extensions (comic) How to run a linux based home web server Microsoft's generosity knows no end for a year (comic) Using the Acer Aspire One as a web server When programmers design web sites (comic) Finding great ideas for your startup Game Theory, Salary Negotiation, and Programmers Coding tips they don't teach you in school When a reporter mangles your elevator pitch Test Driven Development without Tears Drawing Graphs with Physics Free up disk space in Ubuntu Keeping Abreast of Pornographic Research in Computer Science Exploiting perceptual colour difference for edge detection Experiment: Deleting a post from the Internet Is 2009 the year of Linux malware? Email Etiquette How a programmer reads your resume (comic) How wide should you make your web page? Usability Nightmare: Xfce Settings Manager cairo blur image surface Automatically remove wordiness from your writing Why Perforce is more scalable than Git Optimizing Ubuntu to run from a USB key or SD card UMA Questions Answered Make Windows XP look like Ubuntu, with Spinning Cube Effect See sound without drugs Standby Preventer Stock Picking using Python Spoke.com scam Stackoverflow.com Copy a cairo surface to the windows clipboard Simulating freehand drawing with Cairo Free, Raw Stock Data Installing Ubuntu on the Via Artigo Why are all my lines fuzzy in cairo? A simple command line calculator Tool for Creating UML Sequence Diagrams Exploring sound with Wavelets UMA and free long distance UMA's dirty secrets Installing the Latest Debian on an Ancient Laptop Dissecting Adsense HTML/ Javascript/ CSS Pretty Printer Web Comic Aggregator Experiments in making money online How much cash do celebrities make? Draw waveforms and hear them Cell Phones on Airplanes Detecting C++ memory leaks What does your phone number spell? A Rhyming Engine Rules for Effective C++ Cell Phone Secrets