65

Is it possible to change the default terminal emulator on Windows (7 and 8 in particular) from Console to, for example, Console2 or ConEmu? In essence, I want all command line tools, whether launched by double clicking, from "Run" or by other processes to use the custom terminal.

This is a trivial matter on Linux, is it even possible on Windows?

It would be especially helpful if this could be done via a script.

Aleksandrs Ulme
  • 955
  • 2
  • 9
  • 10
  • 6
    s/terminal emulator/shell? (cmd.exe is not a terminal emulator, it is a shell.) – Hennes Nov 23 '12 at 14:06
  • As I understand it, both the the shell and the terminal emulator share the name. If it's not the case, I have no idea how the actual terminal emulator window is called. – Aleksandrs Ulme Nov 23 '12 at 17:13
  • 2
    Hey, it is called "console" ;) Hennes is absolutely right, for example, when you Win+R "powershell" - it will be started in the same terminal as "cm.exe" – Maximus Nov 23 '12 at 17:22

2 Answers2

84

Default terminal

You may set up ConEmu as default terminal for cmd.exe, tcc.exe, powershell.exe or any other console application. In fact, you choose from what application you need to run any console application, even from Visual Studio for debugging your console applications.

ConEmu's Default Terminal set up

Just turn on checkbox, point applications from you like to start console tools (for example explorer.exe|totalcmd.exe|wdexpress.exe) and voila. You may press Win+R type ipconfig /all and press Enter. You may even start your console application in Visual Studio debugger. New console will starts attached to the new ConEmu tab. You may also doubleclick on some executable in the Explorer window.

You may find more information about the feature in the project wiki: DefaultTerminal.

Alternative

Also, there is an alternative less preferable way to auto run ConEmu on cmd.exe and tcc.exe startup. Just press "Register ConEmu autorun" in Settings -> ComSpec.

Maximus
  • 20,637
  • 16
  • 91
  • 116
3

In order to change the default shell to anything, you have to change the ComSpec environmental variable.

On Windows 7, you Right click My ComputerPropertiesAdvanced system settings (on the left pane). Go down to the bottom and select Environment Variables.... Change the ComSpec to whatever shell application you want.

The default value is %SystemRoot%\system32\cmd.exe.

For PowerShell it is %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe.

System properties window

Environment Variables window

robinCTS
  • 4,327
  • 4
  • 20
  • 29
Tony
  • 49
  • 5
  • This answer is even better, because it doesn't imply dependence on 3rd party apps. – setec Dec 09 '20 at 08:09
  • 1
    This answer is about changing the shell. What program gets used to interact with the shell is a different matter. You can run cmd or powershell or git bash in any console program you like, eg. conEmu. – stib May 07 '21 at 05:22