🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5022

Re: Disabling an Internal DOS Command

#5022
From: mr. yawei
Date: Tue, 05 Mar 1991 02:06
37 lines
2106 bytes
In article <1991Mar4.151301.12925@cbnewsk.att.com> konopka@cbnewsk.att.com (raymond.konopka..jr) writes:
>I have written an enhanced Change Directory command for DOS and I
>would like to call it cd, however, since 'CD' is already an internal
>command, command.com always executes the internal command.  Is
>there any way to disable a DOS internal command, specifically 'CD'?

Use any binary editor to search for the string 'CD' in COMMAND.COM,
then replace it with something different. (I'd just replace it with
lower case 'cd'.) 

A short string like 'CD' may generate multiple matches. In that case
look at the vacinity of each match to determine which match is inside
the internal command table. The right one should have all the other
internal commands next to it.

CD is a redundant command. After disabling it you can still use CHDIR.
Keep a copy of COMMAND. Even if you do not make errors while patching,
you still need a good copy to format floppy disks.

Another way to execute a program on disk that bears the name of an
internal command is to specify the path or part of the path. For
example, "C:CD" will executes a program "CD" from drive C:.

>Question #2:
>Is there any way to set the state of the NumLock key.  I already know
>how to detect the state of the key, but what I really need to do is
>set it to be either on or off.  Any help would be appreciated.

Just set or clear bit 20H at 0040:0017. Generally a bad idea, as it
distroys the synchronization between the keyboard status lights and
actual system status on many systems.

>Thanks in advance

You are welcome.

Ya-Gui Wei
Technical Details
Message-ID: <1991Mar5.020630.15228@bronze.ucs.indiana.edu>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!bronze!yawei
References: <1991Mar4.151301.12925@cbnewsk.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!bronze!yawei
From: yawei@bronze.ucs.indiana.edu (mr. yawei)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Disabling an Internal DOS Command
Message-ID: <1991Mar5.020630.15228@bronze.ucs.indiana.edu>
Date: 5 Mar 91 02:06:30 GMT
References: <1991Mar4.151301.12925@cbnewsk.att.com>
Distribution: usa
Organization: Indiana University, Bloomington
Lines: 37