[comp.lang.c] PC DOS "Bad command or file name" interrupt wanted

sarathy@gpu.utcs.toronto.edu (Rajiv Sarathy) (09/13/88)

Let me re-phrase the "Subject".

I want DOS to jump to my memory-resident-program instead of printing
"Bad command or file name" whenever appropriate.

Yes, I tried posting to "comp.sys.ibm.pc", but to no avail.

Maybe you C fella's know more about it.

Could it be an interrupt somewhere?  If so where should I look it up?
If it isn't an interrupt, what is it?  Is it possible to do something like this?
Is there somebody, or some source (book?) that might guide me, or give me some
hint?  Is there some way of reaching someone from Microsoft on the net?  Is
there someone from Microsoft reading this?  Is Microsoft even connected?
Are these questions redundant?  Are they rhetorical?

Thanks in advance.

-----
Disclaimer: I'm just an undergrad.
-----

simrin@mis.ucsf.edu (Steve Simrin) (09/13/88)

In article <1988Sep12.202413.23423@gpu.utcs.toronto.edu> sarathy@gpu.utcs.UUCP (Rajiv Sarathy) writes:
>Let me re-phrase the "Subject".
>
>I want DOS to jump to my memory-resident-program instead of printing
>"Bad command or file name" whenever appropriate.
>
>Yes, I tried posting to "comp.sys.ibm.pc", but to no avail.
>


DOS uses the EXEC function (Int 21h function 4Bh) to load programs and
external commands. You might try trapping calls to this function and
checking for the error. If the error is there send control to your
handler, then to the standard handler. If there is no error, just chain
to the normal handler.
 
 Steven Simrin

dhesi@bsu-cs.UUCP (Rahul Dhesi) (09/14/88)

In article <1988Sep12.202413.23423@gpu.utcs.toronto.edu> sarathy@gpu.utcs.UUCP
(Rajiv Sarathy) writes:
>I want DOS to jump to my memory-resident-program instead of printing
>"Bad command or file name" whenever appropriate.

Nitpicking:  You can't make MS-DOS jump.

Answer:  The "Bad command..." error message comes from the MS-DOS
command interpreter which lies in the file "command.com".  I greatly
doubt that you can make "command.com" transfer control to a
memory-resident program when it sees an invalid command.

Follow-ups to to comp.sys.ibm.pc, please.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!dhesi

Ralf.Brown@B.GP.CS.CMU.EDU (09/14/88)

In article <1359@ucsfcca.ucsf.edu>, simrin@mis.ucsf.edu (Steve Simrin) writes:
}In article <1988Sep12.202413.23423@gpu.utcs.toronto.edu> sarathy@gpu.utcs.UUCP (Rajiv Sarathy) writes:
}>I want DOS to jump to my memory-resident-program instead of printing
}>"Bad command or file name" whenever appropriate.
}
}DOS uses the EXEC function (Int 21h function 4Bh) to load programs and
}external commands. You might try trapping calls to this function and
}checking for the error. If the error is there send control to your
}handler, then to the standard handler. If there is no error, just chain
}to the normal handler.

Except that COMMAND.COM issues the message after it searches the PATH, not
after the EXEC fails.  If the file is not found, EXEC is never called.
--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=-=-=- Voice: (412) 268-3053 (school)
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: Ralf Brown 1:129/31
Disclaimer? I     |Ducharm's Axiom:  If you view your problem closely enough
claimed something?|   you will recognize yourself as part of the problem.