Can I use my DIR.EXE 
Author Message
 Can I use my DIR.EXE


 In> Dear Pascalese,

 In> I have written an alternative dir command. Does anyone know how to
 In> either:
 In> A) replace the original DOS dir command (I presume this command is
 In> INTERNAL  and cannot be replaced without altering COMMAND.COM, which I
 In> don't want to do)
 In> B) tell DOS to use my DIR.EXE instead of it's own (at the moment I
 In> cannot run  dir.exe, since the DOS DIR command is implemented first -
 In> is there a way of  overiding the order in which commands are processed
 In> i.e. EXTERNAL progs then  INTERNALS)

 In> cheers, Alex.

Normally I don't think you can, since DOS looks to see if the command is
an internal one first, before looking for an executable in the path. There
are two methods that I can think of, other than altering COMMAND.COM, but
they may not be satisfactory for you:

 1) Rename our DIR.EXE to something like DDIR.EXE
 2) Use an alternate command interpreter such as 4DOS, which allows you
    to override the normal internal DIR command with your own.

The makers of 4DOS (an excellent product BTW) are able to do it by replacing
the command interpreter COMMAND.COM with their own.

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

  %               http://www.*-*-*.com/ ~kforwood/              $
  $         For what purpose is life, if one cannot live freely?         %
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

___ Blue Wave/QWK v2.20



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE




 |> Dear Pascalese,
 |> I have written an alternative dir command. Does anyone know how to either:
 |> A) replace the original DOS dir command (I presume this command is INTERNA
 |> and cannot be replaced without altering COMMAND.COM, which I don't want to
 |> do)
 |> B) tell DOS to use my DIR.EXE instead of it's own (at the moment I cannot
 |> dir.exe, since the DOS DIR command is implemented first - is there a way
 |> overiding the order in which commands are processed i.e. EXTERNAL progs th
 |> INTERNALS)

 In> Not that I am awre off, you could either

 In> a) rename your program so there is no conflict

 In> b) type the full name (ie DIR.EXE) so there again is no conflict

 In> c) get 4DOS and try an alias (not sure what the outcome will be..)

Yes, you can alias an internal command with 4DOS very easily, without any
problems. I've been using 4DOS for three years steady and have never found
a single problem with it. I think DOS wouldn't even be considered "dead"
by all those Windoze hardheads if they ever tried this excellent product,
and maybe DOS based Pascal would have a chance of survival since more
people would realize that things can be done quicker on the keyboard than
having to always move between it and the mouse to work. But I guess this
discussion I'm trying to start belongs in a more appropriate newsgroup...

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

  %              http://goodship.cn.camriv.bc.ca/~kforwood/              $
  $         For what purpose is life, if one cannot live freely?         %
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

___ Blue Wave/QWK v2.20



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE

Quote:




> |> Dear Pascalese,
> |> I have written an alternative dir command. Does anyone know how to either:
> |> A) replace the original DOS dir command (I presume this command is INTERNA
> |> and cannot be replaced without altering COMMAND.COM, which I don't want to
> |> do)
> |> B) tell DOS to use my DIR.EXE instead of it's own (at the moment I cannot
> |> dir.exe, since the DOS DIR command is implemented first - is there a way
> |> overiding the order in which commands are processed i.e. EXTERNAL progs th
> |> INTERNALS)

I expect you can use DOSKEY to create an alias that points to your DIR command.
At least it works in a DOS window in Win95. I have a CD command that works much
like the UNIX CD but even better.

------------------------------
Jim Weisgram
Oregon Dept. of Transportation
(503)986-3211



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE


:
:  In> Dear Pascalese,
:
:  In> I have written an alternative dir command. Does anyone know how to
:  In> either:
[Replace dir command or instruct DOS to use different dir command]

If you're using doskey (and you should) :-)then you should be able to
define dir as a macro which can then call your program.

Steve

--
 ____ ____

\__ \ |  _/-----------------------------------------------------
/___/ |_|    (yes, I know it's a BUAF, but it's *my* BUAF) :-)



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE


 >Thus "DIR" will always be processed internally by command.com:  it doesn't
 >matter where on your hard drive you put a "dir.exe": command.com won't
 >think it  needs to go looking for it.

 In> Wrong.  OR at least it's wrong in Norton dos's implementation.

 In> http://www.webworldinc.com/joejared/
 In> ftp://webworldinc.com/joejared/
 In>  ! Origin: BP what??? (1:103/5)

Norton's DOS (or NDOS) is not an ordinary command shell, and provides
extentions and greater flexibility than the normal (MS)DOS, one of which is
aliasing, which allows an external program to override an internal command
by the same name. NDOS is essentially the same thing as 4DOS, of which I
mentioned earlier.

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

  %              http://goodship.cn.camriv.bc.ca/~kforwood/              $
  $         For what purpose is life, if one cannot live freely?         %
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

___ Blue Wave/QWK v2.20



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE


 >Thus "DIR" will always be processed internally by command.com:  it doesn't
 >matter where on your hard drive you put a "dir.exe": command.com won't
 >think it  needs to go looking for it.

 In> Wrong.  OR at least it's wrong in Norton dos's implementation.

 In> http://www.webworldinc.com/joejared/
 In> ftp://webworldinc.com/joejared/
 In>  ! Origin: BP what??? (1:103/5)

Norton's DOS (or NDOS) is not an ordinary command shell, and provides
extentions and greater flexibility than the normal (MS)DOS, one of which is
aliasing, which allows an external program to override an internal command
by the same name. NDOS is essentially the same thing as 4DOS, of which I
mentioned earlier.

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

  %              http://goodship.cn.camriv.bc.ca/~kforwood/              $
  $         For what purpose is life, if one cannot live freely?         %
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

___ Blue Wave/QWK v2.20



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE




 : >Thus "DIR" will always be processed internally by command.com:  it doesn't
 : >matter where on your hard drive you put a "dir.exe": command.com won't
 : >think it  needs to go looking for it.

 In> : Wrong.  OR at least it's wrong in Norton dos's implementation.

 In> Why not patch "COMMAND.COM".. 2 or 3 minutes work on MS-DOS 6.22's
 In> COMMAND.COM (time stamp 6.22  31.05.94, size 54,645 bytes) revealed
 In> at hex C110-C112 the string "DIR", changing this to "ZZZ" (or
 In> whatever) prevents there being an internal command "DIR", then do
 In> exactly what you like....

The original poster specified that he did not want to do that. I can think
of a number of reasons why he wouldn't want to.

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

  %              http://goodship.cn.camriv.bc.ca/~kforwood/              $
  $         For what purpose is life, if one cannot live freely?         %
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

___ Blue Wave/QWK v2.20



Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE

Quote:




>  : >Thus "DIR" will always be processed internally by command.com:  it doesn'
>  : >matter where on your hard drive you put a "dir.exe": command.com won't
>  : >think it  needs to go looking for it.

>  In> : Wrong.  OR at least it's wrong in Norton dos's implementation.

>  In> Why not patch "COMMAND.COM".. 2 or 3 minutes work on MS-DOS 6.22's
>  In> COMMAND.COM (time stamp 6.22  31.05.94, size 54,645 bytes) revealed
>  In> at hex C110-C112 the string "DIR", changing this to "ZZZ" (or
>  In> whatever) prevents there being an internal command "DIR", then do
>  In> exactly what you like....

> The original poster specified that he did not want to do that. I can think
> of a number of reasons why he wouldn't want to.

Actually, I'm not sure if it's been mentioned in this thread yet, but if you're
using NDOS or 4DOS as a command shell (as I do), it provides a simple way to
disable and enable internal commands:

setdos /i-dir  <- disables the internal "dir"
setdos /i+dir  <- reenables the internal "dir"

This will make the shell ignore the internal command and scan the path for a
"dir.com", "dir.exe", "dir.bat", or "dir.btm".  Just put this at the end of the
AUTOEXEC.BAT, and it shouldn't be a concern any longer.

Personally, I'd recommend 4DOS/NDOS over COMMAND.COM any day because they're
far more productive than the plain old shell, even with DosKey installed.

Quote:
>         -- Kim Forwood --

--
Scott Earnest                      | _,-""-_,-""-_,-""-_,-""-_,-""-_,-" |




Wed, 18 Jun 1902 08:00:00 GMT  
 Can I use my DIR.EXE


: >
: >  In> Why not patch "COMMAND.COM".. 2 or 3 minutes work on MS-DOS 6.22's
: >  In> COMMAND.COM (time stamp 6.22  31.05.94, size 54,645 bytes) revealed
: >  In> at hex C110-C112 the string "DIR", changing this to "ZZZ" (or
: >  In> whatever) prevents there being an internal command "DIR", then do
: >  In> exactly what you like....
: >
: > The original poster specified that he did not want to do that. I can think
: > of a number of reasons why he wouldn't want to.

: Actually, I'm not sure if it's been mentioned in this thread yet, but if you're
: using NDOS or 4DOS as a command shell (as I do), it provides a simple way to
: disable and enable internal commands:

: setdos /i-dir  <- disables the internal "dir"
: setdos /i+dir  <- reenables the internal "dir"

To be brutally honest I've never used NDOS or 4DOS, I find 'ls' to be far
more flexible, and if I want to change it the source is there. I have DOS
on a small partition for compatibility with machines at work... Dos 6.22
Windoze 3.1, Word 2, Excel 4 .. er, that's it. I just posted because that's
the sort of thing I used to do all the time 8 or 9 years ago...I even had a
programme (still have somewhere) that I wrote, for which I had to patch
out the internal 'copy' command - mine had a command line option which made
it behave like 'move' now does. These days I just browse the pascal hierarchy
for old times sake....
--
--------------------------------------------------------------------
                 Tony Quinn --- The Voice of Insanity

--------------------------------------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Can I use my DIR.EXE instead of DOS's

2. It's not bad canned meat...

3. Question: (FPC): is the FP.EXE in de WIN32 different than the FP.EXE in the GO32V2 dir?

4. Using another DPMI-host than RTM.EXE from a Borland Pascal 7.01 program

5. Saving exe. files using TP

6. .CHR, .BGI into .EXE using EXTENDED MEMORY

7. TPX.EXE AND TURBO.EXE {difference between}

8. TPX.EXE and TURBO.EXE

9. Windows EXE and DOS EXE

10. EXE to PAS or EXE to C\c++ ?

11. Appending exe to exe file

12. an exe form an exe

 

 
Powered by phpBB® Forum Software