How to change the default terminal emulator on Windows (cmd)?

63

29

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

Posted 2012-11-23T13:54:54.210

Reputation: 935

5s/terminal emulator/shell? (cmd.exe is not a terminal emulator, it is a shell.) – Hennes – 2012-11-23T14:06:57.827

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 – 2012-11-23T17:13:03.170

2Hey, 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 – 2012-11-23T17:22:56.900

Answers

79

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

Posted 2012-11-23T13:54:54.210

Reputation: 19 395

Is it possible to start up as Admin? – Jeremy Holt – 2014-07-30T10:30:46.990

@JeremyHolt start what? Thought, you need to use "as admin" feature from where you try to start it. And I think, may be you need to ask another Q. with description of your use case. – Maximus – 2014-07-30T11:09:41.257

@Maximus with the above option, I am able to get win+r ipconfig and .exe in win exp run in conemu. But is doesn't work when I run my console app from Visual Studio. What am I missing? – Rashmi Pandit – 2016-03-31T05:55:10.293

Have you add your visual studio executable? – Maximus – 2016-03-31T18:19:48.720

Unfortunately it doesn't work with console projects you wish to debug in Visual Studio, still loads regular cmd ;( – GONeale – 2016-06-05T00:50:33.780

Didnt work. Win+R -> "ipconfig /all" - brings old cmd window that disappears right away – monstro – 2016-10-04T13:47:27.377

4Thank you, although I am looking for a more general solution! Also, thank you for your work on ConEmu, it's amazing! – Aleksandrs Ulme – 2012-11-23T17:13:33.997

7"General" solution is impossible in Windows. – Maximus – 2012-11-23T17:20:24.487

Though so, thank you! Too bad I can not mark the comment as the accepted answer. – Aleksandrs Ulme – 2012-11-23T17:26:41.230

5Answer updated, new build arrives. – Maximus – 2012-11-25T02:02:32.150

4This is an amazing program. I was all happy with Consol2. Till I found this. This takes the whole think to a whole new level. Thank you man. It makes me wonder how I never heard of it. – stardust – 2013-05-07T16:29:20.043

Everything perfect, but there is a mistake in screenshot. There should be explorer.exe|vcexpress.exe instead of explorer.exe, vcexpress.exe. Thanks for this tool, it's amazing ;) – Kamil Budziewski – 2013-08-01T06:14:34.403

1

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

Tony

Posted 2012-11-23T13:54:54.210

Reputation: 11