[comp.binaries.ibm.pc.d] v08i302: savedir, save current dir and cd

ts@uwasa.fi (Timo Salmi) (11/26/90)

In article <2372@sixhub.UUCP> ibmbin-request@crdgw1.crd.ge.com writes:
>Archive-name: savedir/part01
>
>  This is another piece of Austrailian shareware, which saves the
>currect directory before going to another.
>
>author's description:
>
>SAVEDIR.EXE - Save directory
>
>Saves the current drive and directory to a batch file which when executed
>restores them and deletes itself unless /D (dont delete) is specified.
>A .BAT extension is automatically added to the filename if required.
>
>SHAREWARE:
>Registration fee: $20 for Private/Domestic use         ($ Australian)
... rest deleted ...

It is nice that we have several programs to select from to perform
the same tasks.  Here I can't help pointing out that you can have a
similar utility for free for private/domestic usage by downloading
/pc/ts/tsbat22.arc from uwasa.fi, or an ftp site near you.  Also the
/pc/pd2/cpcug.zip utilities collection has a pushdir.com and
popdir.com, which can be used to the same effect.  And these
utilities can be found in PC-Maganize's collections, too, as far as
I know. 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

fisher@sc2a.unige.ch (11/30/90)

[REPOST, due to NEWS problems]

About c.b.i.p's:
> Posting-number: Volume 08, Issue 302
> Submitted-by: rxcob@minyos.xx.rmit.oz.au
> Archive-name: savedir/part01
> 
>   This is another piece of Austrailian shareware, which saves the
> currect directory before going to another.
> 
> author's description:
> 
> SAVEDIR.EXE - Save directory
> 
> Saves the current drive and directory to a batch file which when executed
> restores them and deletes itself unless /D (dont delete) is specified.
> A .BAT extension is automatically added to the filename if required.
> 
> SHAREWARE:
> Registration fee: $20 for Private/Domestic use         ($ Australian)
>                   $30 for Professional/Commercial use  ("      "    )

I'd hate to spoil the autralian shareware market, but IMHO, any owner of
a decent compiler can write himself such a program.  But the problem is
one of analysis.  I'm no professional either, but this is clearly a case
of `let's program first, we'll think later...'.

An example:

C:\ADM\LETTERS\1990> savedir work
[ 
work.bat is now:
  @C:
  @cd \ADM\LETTERS\1990
  @del WORK.BAT
]
C:\ADM\LETTERS\1990> cd \
C:\> d:
D:\> cd \games
D:\GAMES> play
[... oops, somebody! ... Ctrl-C, quick! ...]
D:\GAMES> work
Bad command or file name

D:\GAMES> c:adm\letters\1990\work
[ nice... :-]


Hmm.  So this is why `pushdir' is often a TSR?  But there is another solution.
A few years back, after reading the manual TurboC, I wrote a small program,
called `write' - now in queue for posting in c.b.i.p -, which simply
translates the string on the command-line much like in the `prompt' syntax.
Thus my own `savedir' is a batch file:

   @ write :Saving cwd $_@$n:$_@cd $p > %TMP%`oldir'%2.bat
   @ if %1~ == -d~ write $_@del %TMP%`oldir'%2.bat >> %TMP%`oldir'%2.bat 

working with an `oldir.bat':

   @ if exist %TMP%`oldir'%1.bat %TMP%`oldir'%1
   @ echo No directory saved   %1

Whenever I need to save the current location (let's say in another batch):

   call savedir -d x
   [...]
   call oldir x

Of course TMP must be set, so that I can locate the file from anywhere...
`C:\TMP\`oldir'x.bat' is:

   :Saving cwd 
   @C:
   @cd C:\ADM\LETTERS\1990
   @del C:\TMP\`oldir'x.bat [ <EOF> is here, not on the next line, of course ]

If you inted to use the `savedir.exe', you should also use the same trick
(i.e. `savedir %TMP%popdir') to be able to locate the batch file when you
need it.

Still, watch out for `mfwrite.zoo', as it's *free*, as well as the two batch
files above :-)

Markus Fischer, Dpt. of Anthropology, Geneva.

ts@uwasa.fi (Timo Salmi) (12/01/90)

In article <1990Nov30.110707.325@sc2a.unige.ch> fisher@sc2a.unige.ch writes:
>> 
>> Saves the current drive and directory to a batch file which when executed
>> restores them and deletes itself unless /D (dont delete) is specified.
... part deleted ...
>
>I'd hate to spoil the autralian shareware market, but IMHO, any owner of
>a decent compiler can write himself such a program.  But the problem is
... part deleted ...
>Hmm.  So this is why `pushdir' is often a TSR?  But there is another solution.
>A few years back, after reading the manual TurboC, I wrote a small program,
>called `write' - now in queue for posting in c.b.i.p -, which simply
... part deleted ...
>Still, watch out for `mfwrite.zoo', as it's *free*, as well as the two batch

As I wrote earlier, but allow me to repeat that a non-resident
batch-based solution already is available in /pc/ts/tsbat22.arc. 
Available from uwasa.fi and Simtel20. 

Just in case, let me repeat that from my part I welcome all useful
alternative, improved or similar solutions to this and other
utilities for general distribution.  This adds to our storage of
programs to choose from, and often teaches us new tricks and views. 
It is only that here I think it relevant to let the users know the
current status of this particular type of utility. 

TSBAT22.ARC     Batch file collection, T.Salmi
Filename        Comment                             Date      Time    CRC
--------        --------------------------------    ----      ----    ---
ADDPATH.BAT     Append directories to the path    10-21-90  17:44:06  3C75
APATH-OM.BAT    Otto Makela's version of addpath  01-13-90  12:32:30  BB69
ARC2ZIP.BAT     Single .arc to .zip with comment  10-21-90  11:11:02  257A
BLANK.BAT       Poor man's screen saver           03-28-90  10:42:54  B2C8
BLK.BAT         Poor man's screen saver & popup   10-21-90  19:51:38  A56D
C.BAT           Lazy changing of directory        03-14-90  15:39:46  C7EC
COLOR.BAT       Set screen color attributes       10-21-90  20:00:02  BD50
D.BAT           Directory with sort & wildserach  10-21-90  20:09:32  9097
DAILY.BAT       Run a program only once a day     10-21-90  20:11:52  2BE5
DELDIR.BAT      Remove directory and its files    10-21-90  20:14:14  32A1
DELPATH.BAT     Delete a directory from the path  10-21-90  18:34:30  0C74
LASTBOOT.BAT    Show date + time of previos boot  10-21-90  20:22:12  DDFD
LINK1.BAT       How to link batch files together  10-31-89  14:26:14  5946
LINK2.BAT       Batch link demo's second file     11-15-89  12:23:24  3048
LOCATE.BAT      Wildcard file find                01-14-90  11:22:56  3A11
LOGRUN.BAT      Log program usage & time and run  04-15-90  22:46:54  92CC
M.BAT           Give multiple MsDos commands      03-04-90  11:08:08  4256
MAKESURE.BAT    Simple command.com virus warning  01-14-90  11:54:56  4B0F
POPDIRE.BAT     Restore (pop) saved directory     01-14-90  11:57:14  3AF7
POPPATH.BAT     Restore the saved path            01-14-90  11:59:44  5655
PUSHDIRE.BAT    Non-resident push directory       01-14-90  11:58:18  7D9C
PUSHPATH.BAT    Save the current path             01-14-90  11:58:44  BB6D
RUN.BAT         Testing for viruses               01-14-90  12:11:24  EB7D
SCANZIP.BAT     Scan for viruses (incl. lzexed)   10-22-90  11:19:18  ECDA
SCOPY.BAT       Copy a file with a single device  06-28-90  12:09:08  F031
SETCOM.BAT      Secure your command.com           10-28-89  19:41:08  B488
SETPUSHD.EXE    Program for nonresident pushdire  01-13-90  17:33:42  2BBD
SETVAR.BAT      Sets a variable for delpath.bat   01-15-90  22:19:38  875B
SHOW.BAT        Wildcard multifile type command   10-21-90  20:40:20  272E
SHOW1.BAT       Auxiliary batch for show.bat      06-01-90  06:07:08  789D
TSBAT.INF       Document                          10-22-90  11:39:20  26A8
TSBAT.NWS       News concerning this package      10-22-90  11:34:56  FAA8
TSPROG.INF      List of PD programs from T.Salmi  10-13-90  09:14:26  F47D
UNPACK.BAT      Unpack-test-view any archivetype  10-21-90  20:45:32  7A18
VAASA.INF       Info: Finland, Vaasa, U of Vaasa  02-02-90  11:52:54  F6C0
VIRUS.BAT       Another batch-based virus test    10-21-90  20:47:04  8EE8
WHERE.BAT       Generic searchstring fname find   10-21-90  20:48:26  0628
ZIPDATE.BAT     Equate .zip date to latest file   01-10-90  22:49:00  F131
ZOO2ZIPH.BAT    Single .zoo to .zip on harddisk   10-21-90  20:50:58  3918
----            ------             ------  -----
0039             79815              45503   43%

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun