SBaronda.com a little place I like to call home.


Turn Off Caplocks Via Powershell

Dec. 30, 2022

As a VIM user I naturally gravigated towards using caplocks as something other than caplocks. I have no need for caplocks at all, therefore, I don't map it to another key. Without caplocks bound, it sometimes presents problems if a game or program enables it. I recently went a week with the caplocks state enabled because I was lazy and didn't want to reboot the computer to reset the caplocks state.

After digging a little bit I found a solution to toggle the caplocks state without rebooting and figured it was worthy of blogging.

Start Windows Powershell and run these commands:

$wsh = New-Object -ComObject WScript.Shell
$wsh.SendKeys('{CAPSLOCK}') # this toggles it, if it's on, it will turn off and vice versa

Hopefully this saves you some pain.


comments powered by Disqus