PowerShell Script to Restart Computer into Bios Screen
Here’s a PowerShell script to restart a Windows computer and boot directly into the BIOS or UEFI settings. This script leverages the Restart-Computer
cmdlet with the appropriate parameter to reboot into the firmware:
# Restart computer to BIOS/UEFI firmware settings
Write-Output "Restarting computer to BIOS/UEFI..."
# Use the Restart-Computer cmdlet with the -Firmware parameter
Restart-Computer -Firmware -Force
Explanation:
Restart-Computer
: This cmdlet restarts the computer.-Firmware
: This option attempts to reboot into the firmware (BIOS/UEFI) settings.-Force
: Forces the restart, bypassing any prompts.
Important Notes:
- This command requires the system’s firmware to support booting into BIOS from within Windows.
- You may need to run the PowerShell script with administrator privileges.
- This feature may not be supported on older hardware or some specific system configurations.
To run this script:
- Open PowerShell as Administrator.
- Paste the code and run it directly, or save it as a
.ps1
file and execute the script by calling it in PowerShell.
This should reboot your system and take you directly to the BIOS or UEFI setup screen, if supported.