Title of cmd windows (in task bar)

1

1

I often find myself end up with several cmd windows which I need to be open for several days at a time.

When I hover on the clumped cmd icon in task bar (in windows 7), it shows me something like this (see screenshot below):

How it looks on my task bar

All those CMDs have different current directory. I always have to do a hit-and-trial to restore every window to find the one where I want to work. If after restoring, its not the intended one, then I minimize it and restore next. Rinse and repeat. Its quite counter-productive.

What I would prefer is that instead of useless information like "Administrator: C:\Windows\system32\cmd.exe", it should show the current duirectory that cmd is in.

Is there a way do achieve this?

bits

Posted 2013-02-15T18:17:50.240

Reputation: 205

Question was closed 2013-02-16T23:10:38.780

Have you considered wrapping CMD in Console2, which will give you tabs in a single window? That would make running so many instances much easier. You could do the same with TCC/LE, which I find much better than CMD. – paradroid – 2013-02-15T19:05:12.603

Check out this question also: http://superuser.com/q/459154/139371 The idea is to use ANSI escape sequences in prompt, but you need to use ANSI "processor" - ConEmu or AnsiCon.

– Maximus – 2013-02-15T21:27:44.757

You might want to check out this solution provided in here. It's pretty much straightforward and suits your needs i think. http://superuser.com/a/143784/155564

– Mariyan – 2013-02-15T19:17:00.537

Answers

4

Within the command window, use the TITLE command.

Syntax
  TITLE [string]

Key
  string  The title for the command prompt window, up to 243 characters.

Kruug

Posted 2013-02-15T18:17:50.240

Reputation: 5 078

1

You can make the Command Prompt change its title whenever the working directory changes.

For example, to achieve this when using cd to change directories, define the following macro

doskey cd=cd C:\cd.bat $*

and create a batch file (C:\cd.bat) containing the following:

@echo off

cd %*

title %cd%

If you write similar files for pushd and popd (just replace cd), you can create a batch file (e.g., C:\macros.bat) that sets the title to the current location and defines macros for cd, pushd, popd and the X: command:

@echo off

title %cd%

doskey cd=C:\cd.bat $*
doskey popd=C:\popd.bat $*
doskey pushd=C:\pushd.bat $* 

for %%b in (A B C D E F G H I J K L M N O P Q R S T U V V X Y Z) do @doskey %%b:=C:\cd.bat /D %%b:

To get a Command Prompt with these macros, either invoke it like this:

cmd /K C:\macros.bat

or create a String value with Name AutoRun and Data C:\macros.bat in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

Dennis

Posted 2013-02-15T18:17:50.240

Reputation: 42 934