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,892 of 68,980    |
|    R.Wieser to All    |
|    Re: how do I set the window title to the    |
|    03 Jul 22 22:13:00    |
   
   XPost: microsoft.public.windowsxp.general   
   From: address@not.available   
      
   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 :   
      
   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%"   
      
   Easy to fix, either use "^%%dd^%%" - or just "%%dd%%". ("^%dd^%" doesn't   
   work)   
      
   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   
   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). :-)   
      
   Also, IFAIKS that "call" in there is not needed.   
      
      
   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)   
      
   Regards,   
   Rudy Wieser   
      
   --- 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