home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,810 of 68,980   
   Kenny McCormack to MikeS@fred.com   
   Re: Question about pushd/popd   
   03 Nov 21 10:14:51   
   
   From: gazelle@shell.xmission.com   
      
   In article , MikeS   wrote:   
   ...   
   >> So, I hope I'm missing something.  Is there any way to tell what   
   >> directories are currently in "the stack" ?   
   >>   
   >They are intended to be used in (batch) programs and work the same as   
   >push and pop a register value in languages like MASM. As you said, if   
   >pushd is used several times without popd your program needs to keep   
   >track of the directories pushed and their order. You can only recover a   
   >lower item in the stack by popping off those above first.   
      
   Of course, it is also possible to use these commands in scripts, but I've   
   always used them mostly interactively.   
      
   If you are familiar with how they work in the Unix shells (most commonly   
   nowadays, this means "bash"), you will see both how useful it is to be able   
   to see what's in the stack (and not just the one on top) and how useful it   
   is to be able to access a directory that is not on the top.  Bash allows   
   both of these functionalities.  Bit of a shame that the one in CMD.EXE is   
   so limited, but I just wanted to confirm that.  Thanks to all who   
   responded.   
      
   I suppose the long-term answer to this and most other "Why is CMD.EXE so   
   limited?" questions is "Use PowerShell".  I have no idea if PS handles this   
   any better than CMD.EXE, since I have never had the slightest inclination   
   to learn anything about PS.  As I like to say, DOS batch is bad, but it *is*   
   the universal language.   
      
   Anyway, as stated, thanks to all!   
      
   --   
   Joni Ernst (2014): Obama should be impeached because 2 people have died of   
   Ebola.   
   Joni Ernst (2020): Trump is doing great things, because only 65,000 times as   
   many people have died of COVID-19.   
      
   Josef Stalin (1947): When one person dies, it is a tragedy; when a million   
   die, it is merely statistics.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca