2

I need to reset the video driver on a Windows 10 machine running ARM32. The old common shortcut (CTRL + SHIFT + WIN + B) works! yes! and produces a single beep as expected, but the keyboard won't be always present so I need to do this via software.

Already tried:

  • Sending the keys to Windows using Powershell (two methods)
  • Sending the keys to Windows using Visual C++ app
  • Sendkeys app utility sending the combination of keys
  • Devcon? read below
  • PnpUtil (read below)

All of that works on Windows (tested, yes), but it doesn't work on Windows ARM32 and I get no error messages. It's possible the dlls or whatever libraries on Windows ARM do not allow these functions, after all I'm finding on other dev threads, it doesn't have the full functionality and some places (official) even mention experimental stuff, after all Windows 10 (32bits) was never officially released, only Windows x64 ARM.

Been trying diff methods but every single one forces me to download gigs of data and libraries in order to build a small exe file that at the end demands 1, 2, 3 extra files for runtime nowhere to be found, and when found... after hours: it doesn't work.

Devcon.exe: this command line utility would solve my issue but I can't find it. I need it to be for ARM32 can't find a single link to it. Found the Source Code but after hours of tunning VS++ and the cryptic tutorials I've found, I always get some new error every time I try to build it and compile it for ARM32. The issue is related to the Windows Driver Kit and I found diverse threads on the web of people having issues getting it to compile. It's mentioned to be contained on the WDK but after downloading diff sets, I couldn't find it there. There are some links to x86 and x64 but not to ARM32, the official documentation from Microsoft states the way to get it is installing WDK, Visual Studio and Windows SDK for desktop, but after doing this... (hours of downloading, installing and searching) was nowhere to be found on my computer.

PnPUtil: the option restart-device should work, it's documented and it's on every Windows since 2004 (according to MS documentation), but in reality while the .exe is there (on Windows), it doesn't have this feature (restart-device) so it doesn't work for my purposes.

Any help will be appreciated.

1 Answers1

2

I'm updating this question as I found the answer, so I hope this becomes useful for others too. It's easy to "reset" the video driver / display using Powershell given you have the right permissions and privileges. How? this way:

$d = Get-PnpDevice| where {$_.friendlyname -like "NAME-OF-THE-DEVICE*"};
$d  | Disable-PnpDevice -Confirm:$false;
$d  | Enable-PnpDevice -Confirm:$false

This will disable the device and then will enable it again, producing a full reset. Depending on your computer, the screen might blink (or not), and the sound of "new detected hardware" might be triggered.

Why did I need this? because the Surface RT1 and Surface RT2 upgraded to Windows 10 have an issue disabling the brightness control after a few minutes of being turned on, it's a bug of an official unreleased Windows version. What I described here works and enables the brightness control perfectly. This can be achieved disabling/enabling the video driver, or just the display (device), as explained, one will cause blink, the other won't. Depending the case you might need to elevate the privileges on your PowerShell script first.

I also found other ways to achieve this via code (C#) or sendkeys and other libraries using C++, but it was a bit messy. The Powershell script solved it easily, then I just added a custom Scheduled Task to be triggered on waking up.

That's it.