Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Declined SETLOCAL: don't record directory changes in batch files

May
13,823
211
I just figured out that directory changes in batch files are "recorded" in the directory history and for use with cd - and cdd -. I've been annoyed by that in the past but hadn't figured out what was doing it. Could SETLOCAL (or some other mechanism) be made to prevent that from happening?
 
I wasn't aware of /X. It can't be used with CD - or CDD - (and those do put the dir in the history).
 
I don't know about the breaking change but that new directory history would only need to accommodate one directory name, the previous directory.
 
I don't understand what you're getting at and I'd really like to. CD - more than once acts like a toggle ... back and forth between the two most recent CWDs, one of which is the the current one.
 
Back
Top