The DOS Batch File from Hell: a confession.

A while back, I was chatting to an IT Support person we’d recently taken on. I discovered that he’d come from a large multinational company that I’d also once worked for.

“It was interesting work.” He said, “There was one curiosity about it, though; The PCs all ran a huge, complex, system for keeping the installations up-to-date. It was based on DOS batch files, for heavens’ sake. When the PCs were switched on, they ran a complex set of batch processes that could run installs, upgrades, or whatever was needed. It all worked fine but it was quite mad. It was very difficult to understand. I’d love to speak to the crazy guy who wrote it and ask him what possessed him to do so.”

“You’re speaking to him. Ask away, matey”.

He was struck dumb with embarrassment. He needn’t have worried; I take the word ‘mad’ as a compliment; in fact, I’m content with almost any human interaction nowadays..

“It was nearly twenty years ago I wrote that. I should explain why.”

(cue ‘sincerity’ music)

“I was charged with coming up with a rational plan for maintaining a network of around a thousand PCs, doubling in size every year. At the time, they had MSDOS, and not much else. How could one check the configurations of the PCs, install software when required, do backups, and maintain a list of who had what software? There were far too many to do by hand, and my budget was vanishingly small.

At that time, there was nothing on the market to do the job. SMS, later called System Centre Configuration Manager, was a long way in the future.

Just to make matters difficult, the IT director had twitched himself awake at some point and decided that nobody in the IT should be allowed to do any programming. Henceforward, all programs would be written by outside companies, and we would merely ‘facilitate’ and manage the projects, write specifications, and supervise acceptance-tests: you know, that sort of thing.

Fine, but these guys from outside companies like to be paid, and I hadn’t the budget.

In your working life, you will often be asked to do impossible things. This is normal, and reflects the fact that life itself is a juggling act that we all eventually fail at.

You may, when you reach the point of being asked for the impossible, become despondent. Not I, for this is a game better than chess, it is referred to colloquially in Britain as the Game of Silly Buggers. (GSB). This is much enjoyed by managers in large companies as it keeps boredom at bay, and defeating this type of management torpidity is the source of great pleasure to those who like to get things done. It is, essentially, the intellectual game of getting around the arcane rules and regulations of large companies, the creeping sclerosis in corporate systems. At work, you generally have to do urgent and important things without being given the time, permission, or resources to do so. The best tactic when trapped in this particular Game of Silly Buggers is to first study the rule-book and exploit the loopholes in the ‘GSB’.

After having read the corporate computer manual cover-to-cover, I began to suspect a flaw in their definition of what comprised an ‘application’, and what therefore constituted ‘programming’.

I phoned the Manager in charge of ensuring compliance.

“Ah, Phil!” (Thinks: what is that fox up to now?)

“Ron, please excuse me, but I’m having some difficulty understanding paragraph 345 sub-paragraph 4: Definition of a computer application. I was hoping for your able assistance”

“I’m only too pleased to assist!” (Thinks: He’s on to some loophole, damn him) “What was the nature of your difficulty?”

“I can understand that an application consists of code, which is subject to all the normal corporate constraints. If I were to write a DOS batch file, would that be deemed to be an application?

“Yes” (Thinks: go away Phil! Hang on a mo. We’ll be swamped with applications!)”No. No, no.”(Thinks: Phew, narrow escape there).

“Excellent. As I tend to get confused, can you just write me an email to that effect?”

“Yes. Was that all?” (Thinks: Go away, Go! Go!)

“It was most satisfactory, Thanks for all your kind help.”

There is little more I need to say. If a DOS batch file was not an application than I would construct a system out of DOS batch files, and escape the ban on developing code, and the almost impossible barriers put in place by the corporate test team. The production managers cursed impotently. They couldn’t prevent it. . The whole IT management structure of the company seemed to focus on stopping the initiative, and the moment it looked like succeeding, announced that it was their doing or idea in the first place.

I discovered amazing things you can do with batch files. Even now I tremble at the potential power offered by SQL Server’s xp_cmdShell As so often in the GSB, the attempt to maintain the day to day equilibrium by preventing any initiatives, actually can lead to a paradoxical breakthrough in the ways of making things happen. I’ll admit, however, that the code looked strange to anyone brought up on Pascal or C++. Although I was proud of the system, and it stood the test of time, I shall take to my grave the memory of that awful look of reproach given me by the unfortunate programmer tasked with maintaining the code after I’d left the department. He had just experienced the start of his own battle with the fates, the Game of Silly Buggers.”