Scott Hanselman

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

August 27, 2019 Comment on this post [9] 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
Hosted in an Azure App Service
August 29, 2019 6:41
Awesome tip. You did not mention though, that a restart is needed after doing this. Rafael's article does though ;);
August 29, 2019 7:45
Ah, sorry, just a restart of Explorer.exe from task manager. ;
August 29, 2019 8:16
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).;
August 29, 2019 9:30
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!;
August 29, 2019 10:59
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!;
August 29, 2019 12:31
trade penguin shrimp yell neil crows http://oudi.tw/bbs/home.php?mod=space&uid=10906 footprints reported helene won ;
August 29, 2019 14:39
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
;
August 29, 2019 17:39
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".;
August 29, 2019 17:50
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...;

(will show your gravatar icon)
Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, li, ol, pre, strike, strong, sub, super, u, ul) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview

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