Using PowerShell to configure the BIOS on Windows

By Tara, 7 April, 2024

Forum
Windows

Hi,
This might interest some of you. Recently, I discovered you can change BIOS settings using PowerShell scripts for some Windows laptops. I'm on an HP machine, and I wanted to change the default behaviour of my function keys. By default, the function keys when pressed don't produce F1 F2 etc., they in fact change the mouse wheel, screen brightness and control the volume for media etc.. If you want normal function key behaviour, you have to press the function key, the key either to the right or to the left of the control key depending on your keyboard, and then the function key you want. This can get very annoying. This is my second HP machine, so on the first one I just put up with it, but I did some googling around for this new machine, and this is what I found.
https://woshub.com/powershell-view-change-bios-settings/
So due to the instructions on this page, my function keys now behave like function keys should! Hope this helps some of you.

Options

Comments

By Unregistered User (not verified) on Monday, May 6, 2024 - 14:03

There’s a easear way to do this, just press function and shift

By Tara on Monday, May 6, 2024 - 14:03

That doesn't sound like a permanent solution to me. It most likely wouldn't lock the function keys permanently. A permanent solution is what I wanted, and I got it when I configured this with PowerShell. I only have to worry about this again when I get a new computer and that won't be for years. Even if I re-install Windows which I did just after doing this because I messed up a software configuration or to, the function keys were still working as I wanted.

By SeasonKing on Monday, May 6, 2024 - 14:03

Hi Tara,
I find this a very useful functionality. I love to play with my windows laptop, install different operating systems etc. I've tried Android, Chrome OS, Ubuntu etc. During such things I have to constantly enable/disable secure boot etc, hopefully this will help me do those bios changes more easily. Obviously if windows doesn't boot up at first place, I won't be able to get in to powershell, so have to be careful about that.
BTW on my dell laptop and thinkpad as well, I was able to change functionality of all function keys with a togle shortcut. FN+escape key toggles the behaviour of function keys, and it's permanent unless you yourself toggle it back with that same keyboard shortcut. The shortcut is scylent though, screen reader doesn't announce anything if you press it.
I don't think this keyboard shortcut toggle exist on HP laptops though, you have to do it either from some preinstalled keyboard tool or from Bios, or from powershell as you suggested.

By Tara on Monday, May 6, 2024 - 14:03

Hi SeasonKing,
there isn't a keystroke that permanently toggles function keys, and there isn't a pre-installed manager for it either or any tool you can install. At least if there is, I never found one. I'm just glad my function keys now behave as they should! Thanks for the info.

By Brian on Monday, May 6, 2024 - 14:03

Wish I knew about this back when i first received my HP laptop. I ended up having a sighted friend assist me with this via the BIOS. Also, and this may have already been mentioned, but HPs do not have a 'Function Lock' like other manufactured laptops. So no Shift + FN or ESC + FN for us. 😣

By Ash Rein on Monday, May 6, 2024 - 14:03

So for most computers, holding down the function key and pressing escape locks the function key into place so that you automatically get F1, F2, F3, etc. I ended up having to buy new windows computer, and I noticed that it was a very annoying process to have to hold down the function key just to get certain keyboard command to work properly. I found this and it’s been working great. So you hold down the function key and then press escape and I believe it permanently yep, the keyboard the way you wanted it and if you wanted to go back to the other way, you do the same thing F4.

By Holy Diver on Monday, May 6, 2024 - 14:03

Doesn't look like this is supported by Asus so I'm out of luck for now. Still, this seems quite useful for much more than merely changing the behavior of the function keys ... not trying to trivialize that need, I get it, this is just so much more than that.

By Tara on Monday, May 6, 2024 - 14:03

Hi,
Yes of course, you can do more with this than just changing function key behaviour. Unfortunately the Function key + Escape doesn't work on my HP laptop. I tried it to see if I could change back and forward between modes but nothing. Still a useful command to know though. I'll bear it in mind for when I get a new laptop.

By Unregistered User (not verified) on Monday, May 6, 2024 - 14:03

On HP press function and shift to switch the function key behavior, doing it again will go back to the way where you need to pres function with other keys

By Voracious P. Brain on Monday, June 2, 2025 - 18:03

Thanks for this. I'm really curious to know if Narrator or JAWS announce the Fn lock toggle state on newish Dell and Lenovo computers. They do on the Surface laptop, and Windows has provided a way to expose the Fn key for a while now. I created an NVDA feature request just to put it on record, but it's been crickets. AFAIK, Lenovo and Dell are the ones with the Fn+Esc combo. I had wondered about HP and Asus, so glad to learn about those. The fact that these manufacturers put their UEFI settings in the registry is certainly news to me, but that's why PowerShell can access them. Lenovo's utility can do a lot of the BIOS stuff, too.

By Michael Hansen on Tuesday, June 3, 2025 - 02:03

Member of the AppleVis Editorial Team

I have a Dell Latitude 5450, and none of the three screen readers (JAWS, NVDA, or Narrator) announce the state of FN + Escape.

By Brian on Tuesday, June 3, 2025 - 03:03

On my HP laptop, while using Narrator, holding the FN key down, while pressing F2 through F12, Narrator will announce what these keys do. It may not say whether or not the FN key is locked, but at least it will tell me when I am using one of these keys.
Alternatively, as long as you are on your desktop, meaning your desktop is focused, NVDA will also read what the function keys do when pressed, while holding down the FN key.

HTH.
PS I have yet to find an FN lock on my particular HP laptop. 🤷🏻‍♂️

Edit, stupid typos…

By TheBlindGuy07 on Tuesday, June 3, 2025 - 23:03

I am lucky to have one hp model where it's left shift and function, and it works perfectly for me to toggle etween media and regular function keys row. I have the hp zbook 14u g6, now running windows 11 pro. A friend of mine has bought another hp recently and for him this shortcut doesn't work. And yes, no screen reader has the ability to announce this change as far as I know. You can use keyboard/input help or whatever it's called for narrator to confirm.
Personally I could never recommend HP again to anyone but this is completely off topic here.
One thing that still prevents me dual booting on windows laptops is the lack of accessibility in the bios on most models. I am very grateful for apple silicon to exist for that.
I read the article and maybe I misunderstood it but there is no mention of changing other bios settings like power management, the os to load and etc?
Thanks for posting this link, I think I'll love this site.

By Voracious P. Brain on Wednesday, June 4, 2025 - 21:03

Well, poot. I was hoping manufacturers other than Microsoft had started exposing that info so that the devs might find it more worthwhile to address. It's really only a problem for Surface users.
Interesting about NVDA announcing hardware keys on the desktop. I'd noticed that it announced volume changes inconsistently, and that's the secret: in program manager, but not apps. Odd.

By TheBlindGuy07 on Thursday, June 5, 2025 - 04:03

Isn't program manager just a title as all the desktop and around is in the explorer.exe process? For me it works anywhere within windows explorer from desktop to taskbar...

By Brian on Thursday, June 5, 2025 - 06:03

@Voracious P. Brain,
I am always adjusting my volume, because I have to for my games. For example, loading up Mortal Kombat, I usually turn my desktop volume up, while turning NVDA volume down. So on my particular HP, the find keys are F6 from mute, F7 for volume down, and FA for volume up. This while holding FN, of course. So if you were at my place, you would hear Mortal Kombat loading, then you would hear volume 50, volume 51, volume 52, volume 53, etc., etc., as I am spamming my volume up key. Lol
This would be with NVDA, but of course also works very well with narrator.

@TheBlindGuy07,
I have no idea what you were trying to ask in your last post. 😑