Hello!
I'm looking for a way to apply automatically a title to the command line window,
whenever I open one by "Open command window here" option in the context menu of explorer;
particularly I want to put as title the current working path-name inside which the window has been opened.
Reason is that usually I maintain several terminal windows opened, and when I need to focus on and restore any of them,
I want to be able to quickly locate it by it's title shown in the jump-list.
Currently what is shown as title is a generic (and useless for the purpose) "Command line".
PS. I hope I've made clear enough my query -- english is not my mother tongue.
regards,
Pete
Automatically apply the current working path as a title to the command line window.
- Simon Sheppard
- Posts: 191
- Joined: 2021-Jul-10, 7:46 pm
- Contact:
Re: Automatically apply the current working path as a title to the command line window.
If you go into the registry
HKCU\Software\Microsoft\Command Processor\
Create a new string value called:
AutoRun
set it to:
That will set the title of each new CMD window (wherever it is opened from) to the current directory when opened, just be aware that if you change directory the title will not automatically update.
HKCU\Software\Microsoft\Command Processor\
Create a new string value called:
AutoRun
set it to:
Code: Select all
TITLE %cd%
Re: Automatically apply the current working path as a title to the command line window.
Excellent tip! it works like a charm.Simon Sheppard wrote: ↑2023-Jun-01, 4:30 pm ...
Create a new string value called:
AutoRun
set it to:That will set the title of each new CMD window (wherever it is opened from) to the current directory when opened,Code: Select all
TITLE %cd%
Thank you very much!
Now that's a really interesting remark. Since tweaking or even substituting the <cd> command,just be aware that if you change directory the title will not automatically update.
being it an internal one, doesn't seem feasible (I'd wish it to be ), a first thought is to introduce
an "extended" <cdx> "command", by creating a little two-lines batch script and moving it into "system32" folder.
Sth like:
Code: Select all
::cdx.bat
@cd %1
@title %cd%
regards,
Pete
-
- Posts: 35
- Joined: 2021-Dec-13, 3:53 pm
Re: Automatically apply the current working path as a title to the command line window.
Maybe >> this << will work?
Re: Automatically apply the current working path as a title to the command line window.
Interesting thread for the matter, tried the accepted answer (particularly as improved by a comment under it), and works fine.
Thanks for the link!