[comp.sys.ibm.pc.misc] Disabling DOS internal commands ?

A.C.G.Saunders@newcastle.ac.uk (Aidan Saunders) (01/23/91)

Is there any way of disabling DOS internal commands ?  Alternatively
can DOS be persuaded to execute a program of the same name as a DOS
internal command without explicitly specifying a path ?

The question arises because I am wondering how we could 'persuade'
users to use Vcopy - the copy program from McAffee Associates that
checks for viruses in the files it copies.  Obviously this can be used
by running it as vcopy - but undergrads being what they are will not
bother to read notices or remember to specify 'vcopy' instead of
'copy'.  So - how could we arrange for vcopy to be invoked when the
user says copy ?

Any ideas ?

Aidan
--
----------------------------------------------
ARPA :: a.c.g.saunders@newcastle.ac.uk
UUCP :: ...!ukc!newcastle.ac.uk!a.c.g.saunders
----------------------------------------------

iisakkil@niksula.hut.fi (Mika R Iisakkila) (01/24/91)

A.C.G.Saunders@newcastle.ac.uk (Aidan Saunders) writes:

> Is there any way of disabling DOS internal commands ?  Alternatively
> can DOS be persuaded to execute a program of the same name as a DOS
> internal command without explicitly specifying a path ?

	Use a binary editor and patch the command names in command.com
into something else. You can't change the lenght of the command names,
but changing 'copy' into 'ypoc' or something should fool the users for
a while... The command name string arrays are near the end of
command.com and easily found. You might probably want to patch a
renamed copy of command.com and use the config.sys's SHELL command.

nee@cf_su20.Sbi.Com (Robert Nee) (01/24/91)

> Is there any way of disabling DOS internal commands ?  Alternatively
> can DOS be persuaded to execute a program of the same name as a DOS
> internal command without explicitly specifying a path ?

The easiest way to disable internal commands is to alter a second
copy of COMMAND.COM with something like Norton.  Search for the
text of the command you wish to alter.  Notice that the commands
are listed on all uppercase.  Simply changing the command to lowercase
will disable it.

This method works because DOS converts you command line to uppercase
before proccessing it.  It then performs a case-sensitive compare
with all of the internal commands.  Since "COPY" won't match "copy" the
command is effectively disabled.  In addition changing the command
to lower case will allow you to easily find where the change was
made in case you wish to alter it later.

If you rename VCOPY to COPY users will really be executing a virus
free copy.  Remember, never try to patch your only copy of 
COMMAND.COM.  Always attempt patches on a backup copy.

Robert F. Nee <nee@cf_su20.sbi.com>

ted@helios.ucsc.edu (Ted Cantrall) (01/24/91)

>Is there any way of disabling DOS internal commands ?  Alternatively
>can DOS be persuaded to execute a program of the same name as a DOS
>internal command without explicitly specifying a path ?
-------------------------------
Search COMMAND.COM for the command "copy" and edit the name to something like
"kopy". Rename "vcopy" to "copy". The details of editing COMMAND.COM are
very fuzzy, so I can't help you more than that. Good luck!
BTW, be sure to document the change so later people can be aware and/or be
able to change it back.			-ted-

-------------------------------------------------------------------------------
ted@helios.ucsc.edu |"He has showed you, O man, what is good; and what does the
W (408)459-2110     |Lord require of you but to do justice and to love kindness
H (408)423-2444     |and to walk humbly with your God?" Micah 6:8 (RSV)

roger@wrq.com (Roger Fulton) (01/25/91)

In article <1991Jan23.120842.3032@newcastle.ac.uk> A.C.G.Saunders@newcastle.ac.uk (Aidan Saunders) writes:
>Is there any way of disabling DOS internal commands ?  Alternatively
>can DOS be persuaded to execute a program of the same name as a DOS
>internal command without explicitly specifying a path ?
>


CED synonyms accomplish this.









Roger Fulton
roger@wrq.com

roy%cybrspc@cs.umn.edu (Roy M. Silvernail) (01/25/91)

A.C.G.Saunders@newcastle.ac.uk (Aidan Saunders) writes:

> Is there any way of disabling DOS internal commands ?  Alternatively
> can DOS be persuaded to execute a program of the same name as a DOS
> internal command without explicitly specifying a path ?

Under 4dos, you can remove or rename any built-in. In fact, I have
renamed the resident 'list' to 'look', and redirected 'list' to point to
LIST.COM. 4dos can be told to use upper-case, and generally look just
about like command.com.
--
Roy M. Silvernail --  roy%cybrspc@cs.umn.edu - OR-  cybrspc!roy@cs.umn.edu
Department of redundancy department, or "Take the long way home...":
main(){system("perl -e '$x = 1/50; print \"Still just my \\$$x!\n\"'");}
               [new year, new .sig, same ol' cyberspace]

fisher@sc2a.unige.ch (01/25/91)

In article <1991Jan23.120842.3032@newcastle.ac.uk>, A.C.G.Saunders@newcastle.ac.uk (Aidan Saunders) writes:
> Is there any way of disabling DOS internal commands ?  Alternatively
> can DOS be persuaded to execute a program of the same name as a DOS
> internal command without explicitly specifying a path ?

Several people replied:
"Run a patched version of COMMAND.COM, in which the "COPY" string has been
changed."

If you use some COMMAND-enhancer (I'm thinking of ANARKEY), or a COMMAND
replacement (4DOS comes to mind), the easiest solution is to work with
aliases:  transparent, easy to understand and to maintain (and no worries
whether binary patches of COMMAND.COM violate it's copyright :-)

Just an opinion...

Markus Fischer, Dpt of Anthropology, Geneva CH