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,876 of 68,980   
   Kenny McCormack to ammammata@tiscalinet.it   
   Re: how do I set the window title to the   
   03 May 22 02:03:15   
   
   From: gazelle@shell.xmission.com   
      
   In article ,   
   Ammammata   wrote:   
   >Il giorno Thu 14 Apr 2022 06:18:18p, *John Gray* ha inviato su   
   >alt.msdos.batch.nt il messaggio   
   >news:ed9b3dae-1ff0-4ff4-91f4-d9c58b4439d5n@googlegroups.com. Vediamo   
   >cosa ha scritto:   
   >   
   >>> In a cmd.exe shell session how do I set the window title to the   
   >>> current directory path?   
   >>   
   >> title %cd%   
   >>   
   >   
   >it works, but when I change folder it does not update   
      
   One way or the other, you will need to alias your "cd" command, so that   
   whenever you change directories, it runs the above "title" command for you.   
      
   I tried to do it with "doskey", like this:   
      
       doskey cd=cd $* ^& title ^%cd^%   
      
   and it almost worked, except that %cd% gets expanded before the "cd"   
   command executes, so it is out of date.  It seems like the delayedexpansion   
   thing would fix this, but I found out that delayedexpansion only works in   
   batch files; it doesn't work at the prompt.  And, of course, doskey macros   
   are command line things, not really batch files.  It would be nice if there   
   was a way of making DOSKEY aliases that span multiple lines, instead of   
   having to slog everything together with &s.   
      
   I think it could be done with an actual batch file, but I lost interest in   
   pursuing it any further...   
      
   --   
   They say that Trump is a stupid man's idea of a clever man, a poor man's   
   idea of a rich man, and a weak man's idea of a strong man.   
      
   Well, Melania is an unclassy man's idea of classy.   
      
   --- 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