🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.misc
Article #3931

Re: store current path

#3931
From: Bill Stewart
Date: Mon, 27 Nov 1995 00:00
36 lines
1938 bytes
> >>Is it possible to store the current path in a variable in a DOS batch
> >>file? Thanks in advance.
> 
> Try (in batch file(s)), 
> 
> oldpath=%path%
> 
> to set the variable 'oldpath' to the current path.
> 
> You can then play with the path setting (for using a particular
> application perhaps).
> 
> to reset the path to what it used to be....
> 
> path=%oldpath%

I think he meant the current directory, not the PATH variable.

My utility GO in the Unique DOS Utilities:

	ftp://ftp.coast.net/simtel/msdos/sysutil/suniq96.zip

lets you save the current directory as a separate batch file, and
then you run that temporary batch file to return to the current
directory, like this:

	go /s > c:\restdir.bat
	(do other stuff here)
	call c:\restdir.bat
	del c:\restdir.bat

This is the quickest way that I know of how to do it.

The Unique DOS Utilities also includes a slew of other handy stuff.

	- Bill (wstewart@unm.edu)
Technical Details
Message-ID: <Pine.A32.3.91.951127203714.87220B-100000@musca.unm.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <48lgfd$h7@nic.umass.edu> <499hr5$5q7$1@sydney.DIALix.oz.au> <49c81g$ch0@ixnews6.ix.netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d683,4c854c1cd2fd1c38
X-Google-Attributes: gid10d683,public
X-Google-Thread: f53ba,1620898bdd53610d
X-Google-Attributes: gidf53ba,public
X-Google-Thread: 111d31,1620898bdd53610d
X-Google-Attributes: gid111d31,public
X-Google-Thread: f71eb,643e1e353ee73714
X-Google-Attributes: gidf71eb,public
X-Google-Thread: 1674b9,1620898bdd53610d
X-Google-Attributes: gid1674b9,public
From: Bill Stewart <wstewart@unm.edu>
Subject: Re: store current path
Date: 1995/11/27
Message-ID: <Pine.A32.3.91.951127203714.87220B-100000@musca.unm.edu>
X-Deja-AN: 120576576
references: <48lgfd$h7@nic.umass.edu> <499hr5$5q7$1@sydney.DIALix.oz.au> <49c81g$ch0@ixnews6.ix.netcom.com>
content-type: TEXT/PLAIN; charset=US-ASCII
organization: University of New Mexico, Albuquerque
mime-version: 1.0
newsgroups: comp.os.msdos.misc,comp.binaries.ibm.pc.wanted,comp.archives.msdos.d,comp.sys.ibm.pc.misc,aus.computers.ibm-pc