Thiemo Mättig

DOS system tools

← Back to the index of my DOS archive

Power Test (1994)

My »PowerTEST« is more a collection of assorted source code snippets from computer magazines of the time. It contains benchmarks and other tests, and shows information about the hardware the tool is running on.

Download assorted source code snippets including this Test (PowerBASIC)

D directory lister (1998)

»D« is short for DIR, the DOS command to list the contents of a directory, the concept Unix systems call ls. My alternative is a bit more compact than what the dir /w command produces. I skip the . and .. entries for the current and parent directories, I do not print so many headers and footers and I use 6 instead of 5 columns. And colors: bright red for executables, dark green for content files (text, images and so on), green for archives (ARJ, RAR, ZIP and more), dark gray for backup and temporary files that may be deleted, and the regular light gray for other file extensions I did not knew. My color selection was not beautiful, but, you know, colors! I always wondered why the DOS command line and the commands build into COMMAND.COM and MS-DOS never used colors, even if color support was available since at least CGA, which was a long, long time ago from my point of view. I wish I could have expanded the existing DIR command without having to rewrite it from scratch, which already gives a first hint at my love for open source. Instead I wrote "D", and barely used it, because DIR was so much more powerful.

Download the »D« source code (PowerBASIC)

Disk Info (1998)

I was always fascinated by computer viruses, even wrote my own proof-of-concept virus in Microsoft Word 6.0's macro language. When I learned how floppy disk boot sector viruses work, I started to study and collect them. A FAT boot sector is a 512 bytes block, with certain bytes reserved. About 400 bytes are left for a machine assembler routine that can either bootload an operating system, or anything a creative programmer wants. My »DISKinfo« utility shows everything that can be said about a floppy disk and it's boot sector on a single ASCII screen.

Download the »Disk Info« source code (PowerBASIC)

Double file finder (1999)

»Double« from 1999 scans for duplicate files, and either deletes or renames them. The feature set is short but still feels like what I would expect from such a tool, even today, in 2017. It's even possible to specify a second directory for comparison. The tool would then delete all duplicates from the first directory. I created this utility to free disk space for my ever-growing collection of images, which took a relevant portion of the 50 to 200 megabytes hard disks I had back then. In contrast to others my tool does not care about file names at all, but compares the actual contents of all files. To speed this process up and to save RAM I never bothered calculating actual checksums (which is what you should do), but store a few bytes from the start, middle and end of each file for comparison.

Download the »Double« source code (PowerBASIC)

ID3DOS v1.1 editor for DOS (1999)

The very first MP3 encoder I used was not able to add title and artist information, so I wrote my own trivial ID3 editor. Version 1.1 refers to the genre byte that was not available in version 1.0.

Download the »ID3DOS v1.1« editor and source code (PowerBASIC)

MD2 (1998)

"MD2" is named after the MS-DOS command MD and literally means "make directory version 2". I wrote this system utility based on an idea by user "chrisp", a mail contact from my Computer-Flohmarkt era in 1998. The tool scans the current directory, for example for ZIP files, and creates an empty folder for each file with the same name as the file. That's the whole idea. There are a few additional features like the possibility to filter by file extension, include the file extensions into the directory names as well as an "undo" function that deletes empty sub-directories. But what I find most notable is the fact that the thing does have an interactive UI. It's not even possible to call it with command line parameters, which would have been totally normal for a system utility like that. But no. I knew I was building a tool for a non-technical user and tried hard to make it as easy to use as possible – although it's a system utility with a quite technical feature set. There is a scrollable preview of what the program will do on the right, an expressive description of the feature set on the top and an always visible list of the things you can do on the bottom. The few graphical elements are meant to resemble LCARS, the Star Trek operating system and UI. Not very successfully since I still had no easy access to reference images via the internet as we know it today.

Download the »MD2« source code (PowerBASIC)

Random file renamer (1999)

My favorite image viewers back then lacked a randomize feature. So I did what I always did and wrote a utility that reorders files by numbering them randomly, while still sticking to the 8.3 filename length limitation.

Download the »Random« source code (PowerBASIC)

T-Code (1993–1995)

I'm not sure any more what the "T" in T-Code means. "Code" is for "encoding", refering to the password you must enter, thats for sure. But "T" could either be "Tastatur", German for "keyboard", which is where you must enter the code, or my first name Thiemo. When you see that I credited my tools with "TM-Productions" in 1993, with "TM" being my initials, it's probably the later.

The tool does one thing: asking for a password and locking the computer after three wrong attempts. That's it. The whole idea came up when I found out that a clever combination of PowerBASIC's KEY n,CHR$(…) and ON KEY(n) GOSUB … allows to disable the Ctrl+Break keyboard shortcut that immediatelly kills the currently running program. I found it funny to play around with the idea of software that had total control over the machine and did not allowed anything but turning off the power. Which was a illusion back then in 1993, because there was no file encryption and you could either skip AUTOEXEC.BAT (which is where the tool would sit and wait) with the same Ctrl+Break shortcut or simply boot DOS from a floppy disk. I even added a backdoor key combination because I was afraid my own tool would lock me out of my computer: Ctrl+Alt+X.

But the tool does the one stupid thing it does with so much joy! The screen fades black by slowly replacing the color of the existing characters on screen with white (which is usually brighter than the default light gray, resulting in a subtile flashlight effect), light gray, dark gray and black. (Wait, black? You can't see that, and the next step is to clear the screen anyway.) The window that asks for the password falls from the top of the screen as a tiny two column wide rectangle, stops and expands to it's full 50 characters width, even illustrated with a sound effect. Wrongly guessing the password for the third time produces an other bright flashlight effect, based on a completely different technology (by manipulating the PALETTE of the few colors on screen), increases suspension by showing a black screen for two seconds, and then shows this awesome "congratulations, you destroyed your computer" animation. I don't remember where I put the code that generated this animation, but I remember writing it. I was pretty proud how blazing fast the animation turned out in the end. My first, obvious attempt to draw the black and white static noise I wanted was to use a CGA mode with as few colors as possible, e.g. SCREEN mode 1 with 320 by 200 pixels and 2 bits per pixel. But creating whole screens full of white noise over and over again was way to slow in these modes, not even close to the 60 times per second I wanted. I found my solution in EGA mode 7, which does have 320 by 200 pixels, 16 colors and up to 8 pages (320 * 200 * 4 bits/pixel * 8 = 250 KiB) that allowed to flip between them literally in the blink of an eye. And that's what I did, randomly showing one of eight different screens of white noise.

Download the »T-Code« source code (PowerBASIC)