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,893 of 68,980    |
|    Herbert Kleebauer to R.Wieser    |
|    Re: how do I set the window title to the    |
|    03 Jul 22 23:19:07    |
   
   XPost: microsoft.public.windowsxp.general   
   From: klee@unibwm.de   
      
   On 03.07.2022 22:13, R.Wieser wrote:   
   > crossposted to crossposted to microsoft.public.windowsxp.general   
   >   
   > Kenny,   
   >   
   > For some "odd reason" I had the same question but posted it into the   
   > microsoft.public.windowsxp.general. Herbert Kleebauer alerted me to this   
   > thread.   
   >   
   >>>set dd=cd   
   >>>doskey cd=cd $* ^&call title %^%dd^%%   
   >>>   
   >>   
   >> Indeed it does! Kudos to you for figuring that out.   
   >   
   > Herbert also posted your final(?) solution :   
   >   
   >> set dd=cd&doskey cd=cd $* ^&call title %^%dd^%%   
   >   
   > I think that you have found out by now that that doesn't quite work. For   
   > multiple reasons :   
      
   Did you try it? Here it works.   
      
   > Take a look at what "doskey /macros" shows you. You might notice that the   
   > stored command replacement is this : "cd=cd $* &call title dd%". Which   
   > ofcourse means that the title of your command window will always be "dd%"   
      
   Here I get:   
      
   D:\>set dd=cd&doskey cd=cd $* ^&call title %^%dd^%%   
      
   D:\>doskey /macros   
   cd=cd $* &call title %%dd%%   
      
      
   > Easy to fix, either use "^%%dd^%%" - or just "%%dd%%". ("^%dd^%" doesn't   
   > work)   
      
   The fix is the bug!   
      
   > The biggest problem however is that the "set dd=cd&" part of your command   
   > isn't stored in the doskey command replacement. Which ofcourse means that   
      
   It don't have to be stored in the doskey macro. It is just a one line   
   replacement for:   
      
   set dd=cd   
   doskey cd=cd $* ^&call title %^%dd^%%   
      
      
   > the current directory is ony *once* stored into the "dd" variable, and than   
   > used for all the window captions. And I don't think that is what you   
   > want(ed). :-)   
      
   Not the current directory is stored in the variable "dd" but the   
   string "cd"   
      
      
   > Also, IFAIKS that "call" in there is not needed.   
      
   Without the call it wouldn't work.   
      
      
   > With the help of JJ I found a solution which seems to work nicely :   
   >   
   > doskey cd=cd /d $* ^& for %%A in (.) do @title %%~nxA   
   >   
   > (caveat: I did my work under XPsp3)   
      
   --- 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