Dec 122017
 
Store and Reset Init Dir In .BATs.
File LASTDIR.ZIP from The Programmer’s Corner in
Category Batch Files
Store and Reset Init Dir In .BATs.
File Name File Size Zip Size Zip Type
LASTDIR.COM 616 359 deflated
LASTDIR.DOC 1566 568 deflated

Download File LASTDIR.ZIP Here

Contents of the LASTDIR.DOC file



LASTDIR.EXE by Ken Hipple [74076,2331]
Ver. 2.0 Mississippi Data Equipment Company, Inc.
(601) 992-9965

LASTDIR places the current directory path into the environment using the
variable name LAST. After LASTDIR is run the command CD %LAST% can be used
by a batch file to return to the current directory from any directory it may
have changed to. The current drive is put into the environment using the
variable name LASTDRV. Placing %LASTDRV% in a batch file will cause the
batch file to change to the drive that was current when LASTDIR was run.

If there is not enough space to insert the current directory
into the environment a message is displayed and ERRORLEVEL is set to 1. If
there is enough room for the directory but not for the drive a different
message is displayed and the ERRORLEVEL is set to 2.
After LASTDIR finds the environment, it works like SET does.
If LAST/LASTDRV is not already in the environment, LASTDIR places it at
the end of the environment. If LAST/LASTDRV is already in the environment
it is removed from its current location, all entries below it are moved up,
and LAST/LASTDRV is then placed in the environment as the last entry.




 December 12, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)