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,880 of 68,980   
   Kenny McCormack to klee@unibwm.de   
   Re: how do I set the window title to the   
   03 May 22 15:30:16   
   
   From: gazelle@shell.xmission.com   
      
   In article ,   
   Herbert Kleebauer   wrote:   
   ...   
   >> 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.   
   >   
   >I don't know anything about doskey so I just randomly   
   >inserted % and ^ in your doskey command and this works   
   >here (but don't understand why).   
   >   
   >set dd=cd   
   >doskey cd=cd $* ^&call title %^%dd^%%   
   >   
      
   Indeed it does!  Kudos to you for figuring that out.   
      
   I suppose this is one of those things where figuring out how to do it is   
   the first step and then figuring out why it works is the next step.   
      
   I wonder if it has something to do with the fact that %cd% isn't really a   
   normal variable; it is what you might call a "pseudo-variable".  Somehow,   
   that causes it to be evaluated differently.  And, somehow, when you put in   
   "dd" in place of "cd", it causes it to go back to the regular evaluation rules.   
      
   Anyway, as far as DOSKEY goes, all I know, I got from doing: doskey /?   
   It is pretty murky stuff.  The fact that the parameters are referenced with   
   a $ sign (like in Unix), rather than with % (like in regular batch files)   
   always trips me up.   
      
   Final question: Just out of curiosity, why do you omit the usual space   
   after the & in your rendition of the doskey command?  I know it doesn't   
   matter, but it seem "ugly" that way.  I've noticed that you've done this in   
   the past as well (in prior postings to this ng).   
      
   --   
   I've learned that people will forget what you said, people will forget   
   what you did, but people will never forget how you made them feel.   
      
    - Maya Angelou -   
      
   --- 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