Scott Hanselman

Totally unsupported hacks - Add Windows Terminal to the Win+X Shortcut menu

August 27, '19 Comments [13] Posted in Win10
Sponsored By

You shouldn't do this and if you choose to do this you may hurt yourself or one of your beloved pets.

You have been warned.

The Windows+X hotkey has been around for many years as is a simple right-click style context list of Developer/Administrator stuff that your techies might need in the course of human events.

There's one obscure setting in Settings | Taskbar where you can set the main option for the Command Prompt to be replaced with PowerShell, although that was flipped to "on" by default many years ago.

Replace Command Prompt with PowerShell

I want Windows Terminal in that Win+X menu.

Fast Forward to a world with lots of alternative console hosts, Linux running on Windows natively, not to mention cross-platform open source PowerShell Core, AND the new open source Windows Terminal (that you can just go download right now in the Windows Store) we find ourselves in a middle place. We want to replace the default console with the Windows Terminal everywhere as the default but that's gonna be a while.

Until then, we can integrate the Windows Terminal into our lives in a few obvious ways.

  • Pin Windows Terminal to your taskbar
  • Train yourself to Win+R and run "wt" rather than "cmd.exe" at wt.exe is a shim that launches the store-based Windows Terminal.
  • Add Windows Terminal to the Win+X menu.

It is that last one that concerns me today.

The Win+X implementation is a totally bonkers thing that I just don't understand with its origins lost to the mist of forgotten time.

You can go check out C:\Users\USERNAME\AppData\Local\Microsoft\Windows\WinX and find it full of LNK files. Just drop yours in there, right? Well, I say nay nay!

They didn't want just anyone dropping stuff in there so to add a new application to Windows+X you need to:

  • Make or find a LNK file for your application.
    • BUT! Your lnk file can't (today?) be a LNK to a Windows Store app - more on that later. They appear to be ignored today.
  • Store a special hash in your LNK file per Rafael's excellent writeup here so that they are considered "Approved Links."
  • Make a new Group 4 folder in the \WinX folder above OR update Group 3 and copy your link in there considering the numbering scheme.
    • Note the ordering in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ShellCompatibility\InboxApp

OR

Here's my WinX\Group3 folder . Note the shortcut at the top there.

image

I wanted to find a link to the Windows Terminal but it's harder than it looks. I can't find a real LNK file anywhere on my system. BUT I was able to find a synthetic one and make a copy by going "Win+R" and running "shell:AppsFolder" which brings you to a magic not-a-folder folder.

Not a folder folder

That is a folder of lies. I tried making a copy of this LNK, moving it to my deskop, hashing it with Rafael's util but it's ignored, presumably because it's a Windows Store LNK. Instead, I'll head out to cmd.exe and type "where wt.exe" to find the wt.exe shim and make a link to that!

C:\Users\scott>where wt.exe
C:\Users\scott\AppData\Local\Microsoft\WindowsApps\wt.exe

These files are also lies, but lies of a another type. Zero byte lies.

Zero Byte Lies

Right-click wt.exe and Create Shortcut. Then drag that shortcut out of there and into somewhere else like your Desktop. You can then use hashlnk and move it to the WinX folder.

OR, you can use this scary and totally unsupported utility hosted at a questionable website that you have no business visiting. It's called Win+X Menu Editor and it was a chore to download. So much so that I'm going to hide a copy in my DropBox for the day in the near future when this utility and website disappear.

Be careful when you go download this utility, the site is full of scary links that say Download Now but they are all lies. You want the subtle text link that points to a ZIP file, just above the Donate button that says "Download Win+X Menu Editor."

In this utility you can add an item that points to your new WT.LNK file and it will use Rafael's code and copy the LNK file to the right place and re-number stuff if needed. Again, be careful as you never know. You might mess up your whole life with stuff like this. It worked for me.

Win+X Menu Editor

And there you go.

Windows Terminal in the WIN+X menu

Lovely. Now IMHO in some ideal future this should just happen out of the box, but until then it's nice to know I can do it myself.


Sponsor: Looking for a tool for performance profiling, unit test coverage, and continuous testing that works cross-platform on Windows, macOS, and Linux? Check out the latest JetBrains Rider!

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.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Thursday, August 29, 2019 6:41:06 AM UTC
Awesome tip. You did not mention though, that a restart is needed after doing this.
Rafael's article does though ;)
Thomas Due
Thursday, August 29, 2019 7:45:41 AM UTC
Ah, sorry, just a restart of Explorer.exe from task manager.
Scott Hanselman
Thursday, August 29, 2019 8:16:27 AM UTC
Nice trick and let's hope it gets integrated offically but I don't see the benefit of having the win+X shortcut instead of having it in the taskbar and using win+1 (or any other number depending on the position).
Sebastien Sevrin
Thursday, August 29, 2019 9:30:39 AM UTC
Reading about wt.exe here allowed me to add Windows Terminal to the Command Line options in Visual Studio like this:
cmd.exe /c start "" "wt.exe"
but it seems you can't just launch wt.exe directly without going through cmd.exe, and there doesn't immediately seem to be any way of passing any other information to the terminal (such as current directory). Still, a step forward, thank you!
Gavin Greig
Thursday, August 29, 2019 10:59:33 AM UTC
FYI placing an ampersand in the shortcut name will set the keyboart accelerator for that entry to the following letter - did this to replace Win+X,A with PowerShell 7!
Sidneys1
Thursday, August 29, 2019 2:39:18 PM UTC
AutohotKey Script for alt/shift/ctrl/t to start development windows terminal or bring it to the front.

+!^t:: ;{ <-- Windows Terminal
Process, Exist, WindowsTerminal.exe
NewPID := ErrorLevel
If NewPID <> 0
WinActivate, ahk_pid %NewPID%
else
Run "C:\Users\username\AppData\Local\Microsoft\WindowsApps\wtd.exe"
return
Doug Heeren
Thursday, August 29, 2019 5:39:18 PM UTC
That "questionable website" (Winaero) is very trustworthy and it's been around for years and they do nothing but help people with their free tools, tips and tricks. It would nice to give them a little respect rather discouraging people by saying "no business visiting it".
Anand Khanse
Thursday, August 29, 2019 5:50:02 PM UTC
For giggles I added a ssh profile with the commandline "ssh.exe username@linuxmachine" and created a new guid for the "guid" field. Works great! I Like have multiple terminal windows in one place rather than multiple windows...
Timothy O. Shenton
Friday, August 30, 2019 12:45:31 AM UTC
Hope someday they pass the path into the Windows Terminal when I type wt in Explorer.
Byron Adams
Sunday, September 01, 2019 11:25:54 PM UTC
Hello, I ennjoy reading all of your article.
I wanted to write a little comment to support you.
Wednesday, September 04, 2019 11:39:21 PM UTC
Why not just move powershell then create a symlink to pwsh ?
Teddy ALBINA
Thursday, September 05, 2019 5:06:59 AM UTC
How can I run the Windows Terminal as administrator? Every time, without having to right click?
Alex
Thursday, September 05, 2019 11:59:05 AM UTC
You woll surely enjoy playing this intense game where
you can use fantasy and creativity possibly at the same time enjoy
and relax. People love Minecraft as a consequence of three simple things, ownership, repllayability
and ease of use. After gathering a couple of stumps, hace wood planks plus a crafting table.
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.