Keeping NumLock on (a nice fix that worked for me)

dwfloydian
dwfloydian Member Posts: 20 Troubleshooter
edited March 2023 in 2017 Archives

First, let me acknowledge that there are many posts around the internet about this Windows 10 bug. Also, I tried the registry edit, but that did not do the trick. The issue is that putting the computer to sleep or hibernate causes the NumLock setting to be turned off. So, I found a post (I don't remember where, unfortunately) that suggested using the task scheduler to run a VisualBasic script that turns on NumLock if it is off. Then I found another post (and I don't recall where this one was found either) that suggested using PowerShell to execute the script rather than VisualBasic. The reason for using PowerShell is the VisualBasic script requires using MS Word to check the NumLock status, but the PowerShell script can check that status without invoking any other programs (as far as I know). The trick, though, is to find the correct trigger for the task to run, since there is no simple default for running a task after the computer awakes from sleep or hibernation. So, I am going to post my screen shots of the settings that I used, as well as the PowerShell script. Again, I did not come up with any of this solution, except to find the correct event trigger for my computer. You may need to experiment with waking your computer from sleep/hibernation to see exactly what events will work for you. They should be similar to the ones I'm using though, I would think.

 

numlockTask0.pngnumlockTask1.png

 

The following event trigger is for when the computer wakes up from sleeping.

 

numlockTask2.png

 

The following event trigger is for when the computer comes out of hibernation.

 

numlockTask3.pngnumlockActions.png

 

The commands that I entered into the follwing window are:

 

"%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe"

 

-command "&'D:\Programs\Utilities\numlockActivator.ps1'"

 

There are no typos. Follow the pattern exactly, including the single quotes or else it probably won't work. It didn't work for me when I neglected to put them in. The file D:\Programs\Utilities\numlockActivator.ps1 is the script that I copied from a source on the internet. I don't recall where I got it from. Here are the contents of that file:

 

if(-not [console]::NumberLock){ $w = New-Object -ComObject WScript.Shell; $w.SendKeys('{NUMLOCK}'); }

 

 

numlockActionsEdit.pngnumlockConditions.pngnumlockSettings.png

 

Good luck! I hope this helps some folks.