Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How to have MS-DOS "remember" logged drive and directory? (Users)

posted by CluelessInSeattl, Seattle, USA, 11.03.2013, 15:39

> You could write the current drive into an environment variable with the SET
> command and then read that later on in the batch file with e.g. %my_drive%

Thanks Georg,

That sounds like a simple and straightforward solution to my problem.

But I have to confess that I don't have a clue how to implement it.

I've been trying over and over, and just keep getting error messages. So I'd be grateful for some hints about how to proceed.

My problem has two parts:

1. How to record the path to the current drive and directory,

2. And then how to log back onto that drive and directory later.

I thought I had already figured out how to solve part 1 by writing the output of the CD command to a text file.

So from the MS-DOS 6.21 command prompt I tried this to turn that text into a variable:

SET DIRPATH <e:\temp\dirpath.txt

That seemed to work; as I didn't receive an error message.

But I don't know how to check to see what was actually saved into the %DIRPATH% variable. (It would be helpful to me if I could look at it to make sure that the correct drive and directory path was actually saved to that variable. Could you tell me how to see what that variable now represents?).

But then, when I typed this at the command prompt:

CD %DIRPATH%

I got an "Invalid directory" error message.

So, as you can see, I'm stumbling around in the dark here. Any light you can shed on my path will be gratefully appreciated.

---
Will in Seattle
a.k.a. "Clueless"
Running MS-DOS 6.21

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum