[comp.binaries.ibm.pc.d] TSR to Ignore commands

ncperson@ndsuvax.UUCP (Brett G. Person) (08/19/89)

I'd like a progran that will cause dos to ignore certain commands 
such as FORMAT or COPY etc.  Does such a program exist? 

-- 
Brett G. Person
North Dakota State University
uunet!ndsuvax!ncperson | ncperson@ndsuvax.bitnet | ncperson@plains.nodak.edu

boyer@iuvax.cs.indiana.edu (08/20/89)

This may not be exactly what you are looking for but it would do the trick.
Try using a TSR that gives you alias capabilities (like DOSEDIT etc.)
and alias the unwanted commands to something else.  Perhaps a batch
file that prints a message stating that the command entered is not allowed.

Dave Boyer

lhf@aries5.uucp (Luiz H. deFigueiredo) (08/21/89)

In article <120800005@iuvax> boyer@iuvax.cs.indiana.edu writes:
>
>Try using a TSR that gives you alias capabilities (like DOSEDIT etc.)
>and alias the unwanted commands to something else.  Perhaps a batch

This would only work if the command *begins* the input line (ie. no spaces)

-------------------------------------------------------------------------------
Luiz Henrique de Figueiredo		internet: lhf@aries5.waterloo.edu
Computer Systems Group			bitnet:   lhf@watcsg
University of Waterloo     (possible domains are waterloo.edu and uwaterloo.ca)
-------------------------------------------------------------------------------

boyer@iuvax.cs.indiana.edu (08/21/89)

lhf@aries5.waterloo.edu writes:

>In article <120800005@iuvax> boyer@iuvax.cs.indiana.edu writes:
>>
>>Try using a TSR that gives you alias capabilities (like DOSEDIT etc.)
>>and alias the unwanted commands to something else.  Perhaps a batch
>
>This would only work if the command *begins* the input line (ie. no spaces)


Spaces are not a problem.  Dosedit can correctly alias a command with 
preceding spaces.  A way to actually get around the aliasing feature is to
include a path to the command.  For instance, /dos/format.  It depends
on the purpose the original poster had in mind.  If the system must be fail-
safe against a malicious user then a new operating system is needed.
If he just wants to prevent the casual uninformed user from doing something
to the system then this solution may work.  Of course, removing format.com
from the path would also work :-)

Dave Boyer

cpcahil@virtech.UUCP (Conor P. Cahill) (08/21/89)

In article <120800006@iuvax>, boyer@iuvax.cs.indiana.edu writes:
> 
> If he just wants to prevent the casual uninformed user from doing something
> to the system then this solution may work.  Of course, removing format.com
> from the path would also work :-)

My solution to this problem was to rename the format program to formit and
alias format to be "formit a:"

fredex@cg-atla.UUCP (Fred Smith) (08/21/89)

In article <2841@ndsuvax.UUCP> ncperson@ndsuvax.UUCP (Brett G. Person) writes:
>
>I'd like a progran that will cause dos to ignore certain commands 
>such as FORMAT or COPY etc.  Does such a program exist? 
>
>-- 
>Brett G. Person
>North Dakota State University
>uunet!ndsuvax!ncperson | ncperson@ndsuvax.bitnet | ncperson@plains.nodak.edu





You don't need a special program -- just rename them to some other
non-obvious name. You could in addition, if you wished, make .bat
files of the original name which print an error message when someone
tries to use them.

Fred

thaler@shorty.CS.WISC.EDU (Maurice Thaler) (08/22/89)

In article <2841@ndsuvax.UUCP> ncperson@ndsuvax.UUCP (Brett G. Person) writes:
>
>I'd like a progran that will cause dos to ignore certain commands 
>such as FORMAT or COPY etc.  Does such a program exist? 
>
>-- 
>Brett G. Person
>North Dakota State University
>uunet!ndsuvax!ncperson | ncperson@ndsuvax.bitnet | ncperson@plains.nodak.edu

Why do people always want to clutter up their memory with TSR's when a
simpler solution exists.

Rename the commands to something less intutitive, like !FORMAT. If you
want, you can edit command.com with a bit editor so the name is changed
slightly for the resident commands. This would take up NO extra memory,
and allow for the same effect. 


Maurice Thaler   SYSOP  Audio Projects BBS (608) 836-9473
                 SYSOP  Power Board    BBS (608) 222-8842  

desnoyer@apple.com (Peter Desnoyers) (08/22/89)

> In article <2841@ndsuvax.UUCP> ncperson@ndsuvax.UUCP (Brett G. Person) 
writes:
> >
> >I'd like a progran that will cause dos to ignore certain commands 
> >such as FORMAT or COPY etc.  Does such a program exist? 

One thing you could do is rename the command to something un-typeable 
(e.g. a string of graphics characters) and then create either a batch file 
or an application to run it. The advantage of the application is that the 
user can't just edit the batch file to do what they want.

E.g. rename format.com to <delta-delta-delta>, then write format.c:
  ...
  printf( "disk to format:");
  scanf( "%s", name);
  if (...disk is c:...)
    printf( "cannot format hard disk.\n"), exit();
  else
    <spawn <delta delta delta> with proper args.>

                                      Peter Desnoyers
                                      Apple ATG
                                      (408) 974-4469

erbo@tangello.ucsb.edu (Eric J. Bowersox) (08/22/89)

In article <2841@ndsuvax.UUCP> ncperson@ndsuvax.UUCP (Brett G. Person) writes:
:
:I'd like a progran that will cause dos to ignore certain commands 
:such as FORMAT or COPY etc.  Does such a program exist? 

Use a program that edits binary files (such as FM or Norton Utilities) to edit
COMMAND.COM.  Locate the command table (where words such as "COPY," "REN,"
and the like are located), then, for each command you want to lock out, change
the name to lower case (e.g. change "COPY" to "copy").

Now, if you want to "bring back" those commands in a form you can actually
use, you can write C/Pascal/assembly/etc. versions of those commands, and
place the appropriate commands (COPY.COM or COPY.EXE, RENAME.COM or RENAME.EXE,
etc.) in a directory where ordinary users can't find it.  Alternatively, keep
a copy of the unaltered COMMAND.COM around, under another name (say, 
FULLCMD.COM), and, for each command you want to "put back," write a batch
file which calls FULLCMD.COM with the /C argument.  For instance:

	@echo off
	: This is COPY.BAT.
	fullcmd /c copy %1 %2
	exit

I ran into a similar situation recently, managing a centralized, "check-out"
laptop at the company I work for...the objective being to guard against
users who "know enough to be dangerous but don't know enough to be safe"
(my words).

(Disclaimer:  Our news files have been cleaned out recently, and I missed a lot
of articles, so if this has been posted before, I'm sorry, but that's why.
Also, I have not tried the strategies mentioned above extensively, having many
other responsibilities at work :-|.)

| Disclaimer: "Disclaimer?!  I don't even KNOW her!!" -- M. Coohill |
| * Eric J. Bowersox (ERBO) *  LIVE! from Isla Vista, California!   |
| erbo@cornu.ucsb.edu ...!{ucbvax,ucsd}!ucsbcsl!cornu!erbo          |
| Brain fried error reading drive C -- Abort, Retry, Ignore, Fail?  |