Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!bellcore!wind!hundt
From: hundt@wind.bellcore.com (tom hundt)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Batch file processing
Message-ID: <3985@bellcore.bellcore.com>
Date: Thu, 3-Dec-87 00:41:16 EST
Article-I.D.: bellcore.3985
Posted: Thu Dec  3 00:41:16 1987
Date-Received: Sun, 6-Dec-87 09:24:55 EST
Sender: news@bellcore.bellcore.com
Distribution: na
Organization: Bellcore, Morristown, NJ
Lines: 22
Keywords: batch, how to save directory
Summary: PUSHDIR and POPDIR to save directory context!

In article <1156@wjvax.UUCP> mario@wjvax.UUCP writes:
> The batch file, of course, can be executed from any 
>directory, but what I want it to do is to return to the directory it was 
>called from.  All I can get it to do is exit to the directory which contains 

I seem to have no problem getting a batch file to end anywhere I want to;
just by putting CD \WHEREVER at the end.

If you want to AUTOMATICALLY return to wherever you were when you ran
the batch file, (presumably the batch file being somewhere in your search
path), you need to save and restore the directory context.  There is a set
of programs PUSHDIR and POPDIR which do just that.  What you do is put
PUSHDIR at the beginning, then CD wherever you want, and when it hits the
POPDIR you put at the end, back you go where you started at.

It's public domain, and I can post if anyone's interested.  (I'd send it
to the .binaries group if someone can tell me this week's procedure :-) )


 /-^-\  Thomas M. Hundt / BELLCORE Morristown NJ / hundt@bellcore.bellcore.com
 |   |  {seismo|ihnp4|ucbvax|decvax|ulysses|allegra|clyde}!bellcore!hundt
/--_--\