Windows – Launch a batch script as shell instead of explorer in Windows 10

hotkeysmicrosoft-officewindows-10-v1909

In Windows 10, the default shell is explorer.exe, giving you the taskbar, desktop icons and start menu.

Since Windows 10 v1909, and possibly v1903, Microsoft has decided to use the hyper key (CTRLALTSHIFTWIN) plus a few keys, the default key for Office applications without allowing users who do not have office installed, use these keys for their own leisure.

I had these keys bound to actions in various programs, but now every one of these keys opens a page in my webbrowser navigating to office365, which I don't use, or, in the case of O for OneDrive, giving me an error message because I don't have OneDrive installed.

There should be the ability to make it open nothing when you press the button, using a registry tweak, but in Windows 10 v1909, that does not work anymore.

I need to get rid of this behavior, so I did some research:

It appears that Microsoft built this support directly into explorer.exe; I can kill explorer.exe and the hotkeys are finally gone, but when I start explorer.exe, they come back.

It appears that on startup of explorer.exe, these keys are registered once, and if the registration of the keys fails, Explorer will not try again. This essentially means that in order to get my hotkeys back, I need to kill Explorer, restart the apps that use these hotkeys, then start Explorer. It is even possible to kill explorer, start an app that registers all the office hotkeys, start Explorer, then unregister the office hotkeys and they are entirely free from that moment on.

Given that for me I just have one program that uses all these global hotkeys, all I need to do is start this program before I start Explorer and I'll be fine.

I could of course run a script that kills Explorer, starts my program, then starts Explorer, but given that this will run at system start anyway, having Explorer flash as a result can be avoided if I can start my startup script instead of Explorer, something that can be done by setting an alternate shell. To my knowledge, however, only .exe files can be set as shell.

Does anyone know how I can set a .cmd file (or other scripting language) as shell, or alternatively, does anyone know of a clean way to solve my global hotkey problem?

EDIT: I am on Windows 10 Pro.

I actually tried to make a VB .net program that would launch explorer.exe after it registered the hotkeys, but can't get it to work reliably. If explorer.exe is not shell, and I start explorer.exe, while it doesn't run, I only get a file browser, not the taskbar etc. If Explorer is the shell, and it starts, killing it by my program aborts the startup sequence, so I have to significantly delay my routine, which means that at some point I get a noticable Explorer restart, which is far from ideal.

I have played with the idea to make my own shell as a replacement for the taskbar and desktop, but given that I use Actual Tools Window Manager, and it relies on Explorer being the shell, that's not really ideal either. So for that reason, this question is still open, although I fear what I'm asking is simply not possible.

Best Answer

Keyboard Filter (WMI Provider Reference)

Supported only in Windows 10 Enterprise and Windows 10 Education

WEKF_PredefinedKey
This class blocks or unblocks predefined key combinations, such as Ctrl+Alt+Delete

class WEKF_PredefinedKey {
 [Static] uint32 Enable (
   [In] string PredefinedKey<
 );

 [Static] uint32 Disable (
   [In] string PredefinedKey
 );

 [Key] string Id;
 [Read, Write] boolean Enabled;
};

Source: Microsoft Docs