[alt.msdos.programmer] Using command.com

joefritz@pawl17.pawl.rpi.edu (Jochen M. Fritz) (01/20/90)

  Is there a way to start command.com with a batch file THEN quit the batch
without quitting the command.com.  I don't want the batch file to load a 
second copy command, and I don't want the /P switch.  Can this be done, and
if so, how?
Thanx
Jochen Fritz "(Noah")
joefritz@pawl.rpi.edu

CMH117@PSUVM.BITNET (Charles Hannum) (01/20/90)

In article <78SYT+@rpi.edu>, joefritz@pawl17.pawl.rpi.edu (Jochen M. Fritz)
says:
>
>  Is there a way to start command.com with a batch file THEN quit the batch
>without quitting the command.com.  I don't want the batch file to load a
>second copy command, and I don't want the /P switch.  Can this be done, and
>if so, how?

I think from your posting that you already understand why COMMAND.COM won't do
this, so I won't go into the details.

The only way to do this (without patching or rewriting COMMAND.COM) would be to
use a program like PC Magazine's KEY-FAKE or my own FAKEKEYS to put a false
command into the keyboard buffer that would call your batch file under the
second COMMAND.COM.  Then, you can simply call COMMAND.COM with no parameters,
it will read the command from the keyboard, and if you hit Break, it will leave
you in the second command processor.  The problem is that if the batch file
exits normally, you will also be left in the second COMMAND.COM.  If this is
what you want, then it will work acceptably.  If not, then you simply cannot do
it.

Note that this will also print things on the screen that you may or may not
want to see.  The DOS banner and the command you simulated in the keyboard
buffer will both be displayed.


Of course, this is not a very good way to do things anyway.  If you could be
more specific about exactly what you are trying to do, the brain-power that
reads this group may be able to offer an alternative.  (This is a general
statement.  When you ask a question, please explain as much about the task you
are trying to accomplish as possible.  This will enable readers to offer
suggestions that will make your life a lot easier.  Of course, hush-hush top
secret information shouldn't be leaked over the net.)


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117@psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h@psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."