Dec 122017
 
Path to non exe com bat files.
File DPATH30.ZIP from The Programmer’s Corner in
Category Utilities for DOS and Windows Machines
Path to non exe com bat files.
File Name File Size Zip Size Zip Type
DPATH30.COM 2816 1748 deflated
DPATH30.DOC 9825 3818 deflated

Download File DPATH30.ZIP Here

Contents of the DPATH30.DOC file


DPATH version 3.0

Written by James A. McGreggor Jr.

Both Dpath v 3.0 and this documentation are hereby contributed to the public
domain in the interests of making PC/MS-DOS the complete product that it
should be. Shame on you, IBM. Microsoft, I have come to expect very little
from you, and you have rarely disappointed me !


New Dpath features:

Beginning with release 3.0, Dpath includes the optional feature of allowing
(most) programs to write to a file which is located in a subdirectory other
than the current directory. This is a powerful feature and AN EXTREMELY
DANGEROUS ONE ! Please do not enable this feature until you have read this
entire document. The default is for this feature to be disabled, and with good
reason. Please experiment on test files only until you thoroughly understand
how it works. In fact, if you feel that you will not be using this option, I
suggest that you stick with Dpath version 2.0. YOU HAVE BEEN WARNED.


What Dpath Does:

Dpath allows DOS to access data files in the same way that DOS currently
locates programs for execution.

Dpath will write to files which are not located in the current subdirectory.

Dpath does not work with the DELETE or RENAME commands. Imagine the problems
that it could cause if it did !

Dpath does not work with programs that use the DOS FIND FIRST function calls,
which is most programs which allow the use of DOS wild-card characters. If it
did, you'd never be sure what it was going to do !


How Dpath Works:

When a file is to be accessed, the current directory is searched, as always.
If the file is not found, the directories in the defined path are searched in
the order specified. If the file is not found, you get the normal "File not
found" message. Otherwise, the file is opened and things proceed normally.


Installing Dpath:

Dpath is installed as a resident DOS extension. You can do this with an
AUTOEXEC.BAT file or by issuing the command from the keyboard. To remove it,
you must re-boot. However, you can turn Dpath on and off with the /O and /NO
parameters.


Dpath Parameters:

? This is a call to Dpath help. All other parameters are
ignored if ? is used and list of options is displayed.

/O Allows Dpath to help with functions that open files. This is
the Dpath default setting.

/NO Effectively disables Dpath. /O and /C work together. If /NO
is in effect, then /NC is also in effect.

/C Allows your programs to write to a file located in a directory
other than the current directory, provided that the file exists.

/NC Disables the /C option.

/P Copies the current path into the resident portion of Dpath.
Allows you to change the current path setting at any time.

/NM Turns off all Dpath messages except error messages.


Default Parameters:

The default parameters are /O/NC. The current path info is not copied
to the resident portion of Dpath unless you use the /P option.


Specifying a path:

The path is defined to Dpath in two ways; via a SET DP=\path;...;\path command
or a PATH \path;...;\path command. The SET DP command will take precedence, if
present. This allows you to specify two different paths, one for programs
(PATH command) and one for data files (SET DP= command).


File names Containing a path specifier:

If you enter a file name with a path specifier, Dpath assumes you know what you
want, and does not interfere.


Hard-coded Drive Specifications:

Dpath will generally work as intended if file names contain a drive specifier.
If the file is found on the drive specified, the operation proceeds normally.
If not, the drive letter is stripped off of the file name and the operation is
retried using the specified path.


Syntax:

Dpath syntax is as follows:

Dpath [?][/O or /NO][/C or /NC][/P][/NM]

Any other parameters will cause an error message and will be ignored.

If ? parameter is used, all other parameters will be ignored.

/NO assumes /NC. /C assumes /O. The reverse is not true.

If parameters conflict (ie. /C/NO), the last parameter in the list,
in this case /NO, will be in effect. The result would be /NO/NC.

If no parameters are used, the current state of Dpath is displayed.


WARNING REGARDING /C OPTION:

If you are not thoroughly familiar with the way the /C option works, disaster
may result. Here is an example. Assume the /C option is active and that the
current directory is DIR1. Also assume that the current data path is \DIR2.

Also assume that you boot up your favorite word processor and tell it to edit a
file called KEYDATA.TXT. Dpath will search DIR1 for the file. If not found,
it will then search DIR2. If found in DIR2, this is the file that will be
modified. If that's what you want, there is no problem. But suppose you
wanted to create a new file in the current directory. You will not be able to
do it if a file with the same name exists anywhere in the current data path.

Another example: Assume default drive A: and data path A:\;A:\DIR1;A:\DIR2.
Also assume you want to format a DOS diskette on drive B:.

You issue the command FORMAT B:/S. The diskette in B: is formatted, as usual.
Then DOS attempts to copy IBMBIO.COM and IBMDOS.COM to B:. The two files are
not found on B:, but they are found on A:. The result is that they will be
copied to A: and not to B: as you had intended. The newly formatted diskette
in B: will NOT contain DOS.

The general rule is as follows:

When the /C parameter is in effect, DPATH v3.0 will NEVER create
a new file if a file currently exists anywhere in the data path
with the same name.

DPATH v3.0 will use the first copy of a file that it encounters,
if the file does not exist within the current subdirectory. The
order in which you specify the subdirectories to DPATH is therefore
important.

If an application program specifies a subdirectory when accessing
a file, DPATH assumes the program knows what it wants, and does
not interfere. However, you may not always be aware that your
program is doing this. If DPATH does not work with a particular
program, this is the most likely explanation. However, DPATH is
not required with programs that are smart enough to look in a
subdirectory other than the current directory, so this is no real
loss. Simply tell your program where your files are located, and
all will be right with the world.....


For best results:

If the /C option causes problems, why did I include it ? Because of popular
demand and against my better judgement. I knew that those who were requesting
this option could handle it, but what about the rest of the Dpath users ?
However, there is a very good reason for having this option:

Suppose your word processor has a dictionary that allows you to add new words.
Without the /C option, you could read the dictionary, but would have a tough
time adding new words. In effect, you would have to keep a copy of your
dictionary in every subdirectory that contained documents that you want to
edit.

With the /C option enabled, you require only one copy of your dictionary. As
long as the data path points to its subdirectory, adding new words is not a
problem.

I have found that the best way to use Dpath is as follows:

1. Place your programs in subdirectories pointed to by your DOS
PATH.

2. Place data files, such as overlays, tables, message files, etc.
in subdirectories pointed to by your "set dp=......." command.

3. Files to be created or otherwise modified should be in the
current subdirectory.


An example using dBase III:

1. The DOS PATH is c:\;c:\dos;c:\progs

2. The datapath is c:\overlays;c:\datafiles

3. The current directory is \databases.

4. \progs would contain DBASE.EXE. \overlays would contain
DBASE.OVR, ASSIST.HLP, and HELP.DBS. \datafiles would contain
DBASEMSG.TXT and \databases would contain the DBF,FRM,FMT, and
MEM files that you create and modify when using DBASE.


An example using Wordstar:

1. WS.COM would be located in c:\progs.

2. WSOVLY1.OVR and WSMSGS.OVR would be in C:\overlays.

3. Wordstar documents may now be edited in any current directory
without requiring the presence of the two OVR files in that
directory.

Used in this way, Dpath is useful without being a danger.


Misfeatures and bugs:

1. Dpath does not work with dBase II when attempting to open
DBASEOVR.COM. I've traced DBASE.COM in an attempt to find
out why and discovered that the program does some really
strange things. I don't know. Ask Ashton-Tate, but I doubt
that they know either. Maybe Wayne Radliff knows.....

2. When using the /C option with Wordstar 3.3, I've noticed that
you can open a file in another directory for edit, but when the
file is saved, it is always saved to the current directory.
Again, I don't know why this happens. I haven't tested this
with prior versions of Wordstar.

3. Programs that create backup files may cause a problem. This
is because they don't really create the backup files. They
simply rename the old file with an extension of BAK or some
such and then save the new file under the old name. Dpath
does not work with DOS RENAME...by design. Therefore, the
/C option when used with this type of program may lead to
complaints about unsuccessful backups.....


Keep on pathin'...............


James A. McGreggor Jr.
1/26/85


 December 12, 2017  Add comments

Leave a Reply