Dec 142017
 
Push/pop current dir & CD enhancer.
File PD11.ZIP from The Programmer’s Corner in
Category File Managers
Push/pop current dir & CD enhancer.
File Name File Size Zip Size Zip Type
PD.COM 12974 7946 deflated
PD.DOC 5462 2239 deflated

Download File PD11.ZIP Here

Contents of the PD.DOC file



PD - Push/Pop Directory
Copyright (c) Lee S. Fields 1988, 1989. All rights reserved.

Please read the licensing information at the end of this document.

FORMAT:
PD [drive:path] | /s[d..] | /? | /h
where drive is the target drive letter
path is the target directory full or ending path
/s forces saving the specified or current drives tree map
/? or /h displays the instructions

OPERATION:

PD, when passed a valid drive and/or path, will store the current drive
and path on a stack file (STACK.DIR), then change to the specified
drive and path. When PD is called without a parameter, it "pops" the
last drive and path from the stack file.

Example:

C:\>pd d:\database

D:\DATABASE>pd c:\dos

C:\DOS>pd

D:\DATABASE>pd

C:\>pd \dos

C:\DOS>pd

C:\>

If you have multiple subdirectories with the same name, PD will go to
the next one if it is run again with the same parameters. An example
might help explain this one.

Example:

C:\>pd data

C:\EDIT\DATA>pd data

C:\LOTUS\DATA>pd data

D:\DATABASE\DATA>pd data

C:\EDIT\DATA>

PD will cycle through all the directories it can find when called with
the same ending path name. If you want to restrict the search to one
drive, the just use the drive and ending path name in the PD command.

Example:

C:\>pd d:data

D:\DATABASE\DATA>pd

C:\>


When PD is run the first time on a drive, it will map the drive and
store the map in a file name LEE_B.SPD. Instead of always typing the
full path name to which you want to change, now you can type just the
ending path name and PD will look it up in the map file and change to
it. It will even handle multiple drives. Why should you have to type
in the full path name when it is already stored in the computer?

Example:

C:\>pd data

D:\DATABASE\DATA>pd dos

C:\DOS>pd

D:\DATABASE\DATA>pd

C:\>pd text

C:\EDIT\TEXT>pd

C:\>

PD, when given the /s parameter, will read the current or specified
drives and update its disk map file for future reference. If PD is
given a path it can't find in the map file, then it will automatically
remap the current or specified drive.

Example:

C:>pd /scd

PD - Push/Pop Directory, Version 1.0
Copyright (c) Lee S. Fields 1988, 1989.

Mapping drive C: .........................................
Mapping drive D: ......

C:>

Upon finding the SPDDIR environment variable, PD will use its value as
the path to store the global map file for all drives. The default for
both environment variables is C:\. By default, the stack file is stored
in the root directory on drive C:. A substitute drive and directory
may be specified in the environment using the environment variable
PDDIR. A excellent place to keep the stack file is a ram disk. To
keep the stack file in the root directory on drive E, for example, put
the command

SET PDDIR=E:\

in the AUTOEXEC.BAT file.

The map file is also stored by default in the root directory on drive
C:. An alternative drive and directory may be specified similar to
PDDIR, but with the name SPDDIR. To keep the map file in a directory
called C:\MAP, add the command

SET SPDDIR=C:\MAP

to the AUTOEXEC.BAT file.

PD can simplify how your batch files work by returning you the same
directory you were in when you started the batch file. A typical batch
file for starting Lotus 1-2-3 with PD might look like:

ECHO OFF
PD 123
LOTUS
PD

This batch file will save the current drive and path, run Lotus, and
then return right to the drive and path from which it was started.


ENVIRONMENT VARIABLES:

PDDIR = path for stack, default = C:\
SPDDIR = path for global PD data file, default = C:\


RETURN CODES:

0 success
1 empty stack
2 path not found
3 error creating stack file
4 error changing to directory
5 error changing to drive
6 no directories found
7 error writing directory map
8 unable to get current path
9 unknown DOS error
10 invalid switch


LICENSING:

PD is not Public Domain or free software. It may be distributed freely
by user groups or bulletin board systems, but use of the software is
limited to licensed users.

You are granted a limited license to use the software for 30 days on a
trial basis. If you wish to continue to use the software after the end
of the 30 day period, please send a $5.00 licensing fee to:

Lee S. Fields
1602 Carters Grove
Katy, TX 77449

By paying the one-time licensing fee you will be granted a full license
to use the software on a single personal computer for business use or
multiple personal computers within the same household for personal use.

Corporate license agreements are available, please contact me for details.

I welcome receiving any comments that you have about PD or suggestions
to improve it.


BACKGROUND:

Why did I write PD? Because I'm lazy and my typing is not always
perfect. I hate typing in full path names on a change directory command
and occasionally misspell them. Besides, all the paths are already
in electronic form, why should I have to do the work when the computer
can do it for me? Another reason is that when I run a batch file, I
want to be left in the same directory as when I started. It's a simple
demand, but one that DOS does not recognize.




 December 14, 2017  Add comments

Leave a Reply