Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!waikato.ac.nz!canterbury!phys169 From: phys169@csc.canterbury.ac.nz Newsgroups: comp.os.msdos.programmer Subject: Re: 4dos: intercepting command lines Message-ID: <1991May31.103200.936@csc.canterbury.ac.nz> Date: 30 May 91 22:32:02 GMT References: Organization: University of Canterbury, Christchurch, New Zealand Lines: 31 In article , m21827@mwunix.mitre.org (Ken Stillson) writes: > I'm trying to write a program for 4dos that will impliment active functions > [like the `command` in unix], and have determined that I would like to > intercept the command-input routine of 4dos. That is, after a command has > been typed in, I would like to interrupt and have the ability to modify > what the user entered. > There are three suggestions, some of which might not work with 4DOS... (1) Intercept in 2E. DS:DI points to the command to execute, change it and pass the result on to the original 2E handler. This doesn't work! I include it here because it is the easiest thing to try, and it *should* work! Neither 4DOS nor COMMAND.COM seems to call it. Perhaps some versions of COMMAND.COM do, but not mine. (2) Intercept interrupt $2F, and watch for AX=AE00, DX=FFFF. This is the "correct" way to extend COMMAND.COM's command processing (from version 3.3 onwards). If 4DOS doesn't support it, jump up and down until it does, because it should. COMMAND.COM makes this call, with DS:BX pointing to the command line, before executing a command; you can change the command line and return 0 in AL, or you can process it yourself and return FF in AL (telling COMMAND.COM not to bother doing anything more with it). (3) Intercept the keyboard input, either with int 16 or int 21. Messy! If you are that desparate, use my own COMMAND.COM replacement, which does what you want plus most of the 4DOS extensions (My system uses [! command] instead of using `command`, since people tend to get ' and ` confused too easily, and because it allows nested active parameters - besides, I'm a fan of AOS/VS). Hope this helps, Mark Aitchison, Physics, University of Canterbury, New Zealand.