How to make Command Prompt, PowerShell, or any Shell launch from the Start Menu directly into Windows Terminal
I love the Windows Terminal, but right now I launch the Terminal, then I pick a Shell (PowerShell, CMD, bash, etc) from the menu. Sometimes I want to be "shell-first."
I'll hit the Start Menu, type cmd, and then the older console/terminal starts up. I have to remember to run Terminal THEN run cmd. So I said to myself, "self, what's a good way to fix that?"
When you press Start and start typing (which is different from WinKey+R and running a .exe directly) you're looking at Shortcuts/LNK files. You can make your own and change existing ones.
Press Start, type "Command Prompt" or "PowerShell" and then RIGHT CLICK the icon and Open File Location.
For example, Command Prompt was here on my machine:
C:\Users\scott\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools
So I Ctrl+C, Ctrl+V to make a copy (backup) or I can just right click and hit properties to change the one I have.
Then I change the Target to wt.exe (Windows Terminal) and pass in the Named Profile for the Shell I want:
C:\Users\scott\AppData\Local\Microsoft\WindowsApps\wt.exe -p "Command Prompt"
In this case, it's Command Prompt. I also renamed my LNK file to Command Prompt (Terminal) but that's optional.
I can do the same thing for PowerShell. I've moved to open source PowerShell 7 (based on .NET Core) that I installed from the Windows Store. Some store apps don't want you to change their icons so I just changed another. You can also make your own with right-click, New Shortcut.
I even did this with the Visual Studio 2019 Developer Prompt by first making a Profile for it in my Terminal settings:
{
"commandline": "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe -noe -c \"&{Import-Module \"\"\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll\"\"\"; Enter-VsDevShell 4f53a196}\"",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff45ce}",
"hidden": false,
"name": "VS2019 Dev Prompt",
"startingDirectory": "%USERPROFILE%"
},
and then changing the icon to call it with wt.exe and the named profile. This can also work with Cygwin, Yori, Ubuntu, or any other shell.
A few minutes and a few shortcut changes later, now I can hit start, type PowerShell, command, cmd, whatever, and it'll all load in Windows Terminal!
Since this technique works only with lnk files that the Start Menu consumes, it also works with PowerToys Run (which is like Quicksilver or Spotlight on Mac)!
Hope this helps!
Sponsor: The No. 1 reason developers choose Couchbase? You can use your existing SQL++ skills to easily query and access JSON. That’s more power and flexibility with less training. Learn more.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
I am happy to find this post Very useful for me, as it contains lot of information. I always prefer to read Thanks.
A very amazing post thanks for sharing with us.
Download the bundle from https://github.com/microsoft/terminal/releases and double click on it. Yes, it's that easy.
ap is a profile that runs a .net console app that accepts commands. If I run it normally, I can continue typing commands until I exit, but if I run a command like 'help' above then it exits when done.
"commandline": "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe -noe -c \"&{Import-Module \"\"\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll\"\"\"; Enter-VsDevShell -VsInstallPath \"\"\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\"\"\" -SkipAutomaticLocation}\""
It wouldn't work without the path. Hope this helps someone.
In the settings you can change the behaviour:
For now, the default is to launch in a new window. Available options include launching in "a new window", "a window on the same desktop", "any existing window"
Comments are closed.