Welcome!

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

SignUp Now!

Bug endlocal not restoring the directory stack or the CWD on drives

Sep
70
1
setlocal
echo C:\
C:\
echo D:\
D:\
echo E:\a
E:\a
pushd c:\windows
pushd d:\proclog
pushd e:\logs
endlocal
echo C:\
C:\
echo D:\proclog
D:\proclog
echo E:\logs
E:\logs
dirs
C:\
C:\Windows
D:\proclog
 
Hello mdlawler - just an aside and not about your question. You may look to enclose your console output in code blocks. Select three "dots" and choose code, paste in your console text, and it is usually much easier to read in a post.
 
Hello mdlawler - just an aside and not about your question. You may look to enclose your console output in code blocks. Select three "dots" and choose code, paste in your console text, and it is usually much easier to read in a

Hello mdlawler - just an aside and not about your question. You may look to enclose your console output in code blocks. Select three "dots" and choose code, paste in your console text, and it is usually much easier to read in a post.
I have not found a good way to do this from the keyboard using my screen reading software yet, but will do so if I figure it out.
 
I always type the code/endcode tags myself, these, without the spaces: [ code ] and [ /code ]. And there are [ icode ] and [ /icode ] (again no spaces) for inline code; I usually select text with the keyboard and choose those from the dropdown (...) menu.
 
I always type the code/endcode tags myself, these, without the spaces: [ code ] and [ /code ]. And there are [ icode ] and [ /icode ] (again no spaces) for inline code; I usually select text with the keyboard and choose those from the dropdown (...) menu.
Thanks Vince, I'll try those the next time.
 
@mdlawler

I see no bug here. After your endlocal command you manually changed the dirs ... so all seems ok.

Or in other words if you would place the endlocal at the end it should be restored (works here).

PS: Microsoft Windows 10 Pro x64 [19045.4412] [22H2] [de-CH] TCMD 32.10.21 x64
 
Last edited:
As @mdlawler said, it doesn't work.

Code:
v:\> type dstack.btm
dirs
setlocal
pushd d:\tc29
pushd d:\tc30
pushd d:\tc31
pushd d:\tc32
endlocal
dirs

v:\> dstack.btm
TCC: V:\dstack.btm [1]  Directory stack empty
V:\
D:\tc29
D:\tc30
D:\tc31
 
And it does work at the command line.

Code:
v:\> dirs
TCC: Directory stack empty

v:\> setlocal

v:\> pushd d:\tc29

d:\tc29> pushd d:\tc30

d:\tc30> pushd d:\tc31

d:\tc31> pushd d:\tc32

d:\tc32> endlocal

v:\> dirs
TCC: Directory stack empty
 

Similar threads

Back
Top