Category filter
Script to hide Restart option in Windows 10/11 devices
In case the organization wants to prevent accidental restarts of their company devices by their employees, Windows offers a provision in the Registry editor to hide the Restart option. IT admins can simplify this process by running a script on the Windows 10/11 device to hide the Restart option from the Start Menu, the Windows sign-in screen, and the ALT+CTRL+DEL screen. Hexnode UEM allows IT admins to remotely deploy these scripts to the endpoints using the Execute Custom Script action.
Batch script
Hide Restart option
|
1 |
REG ADD "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "HideRestart" /t REG_DWORD /d 1 /f |
Updating the data of registry option “HideRestart” present under HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start in the Registry Editor to 1 hides the Restart option in the device. /f is used to force the overwriting of the existing entry without prompting.
Re-enable Restart option
|
1 |
REG ADD "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "HideRestart" /t REG_DWORD /d 0 /f |
Changing the value assigned to registry option “HideRestart” back to 0 brings back the Restart option in the device.
PowerShell script
Hide Restart option
|
1 |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start" -Name "HideRestart" -Value 1 -Force |
The script uses the Set-ItemProperty cmdlet to change the value of the registry option “HideRestart” to 1, thus removing the Restart option from the Start Menu, Windows sign-in screen, and ALT+CTRL+DEL screen.
Re-enable Restart option
|
1 |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start" -Name "HideRestart" -Value 0 -Force |
Setting the –Value parameter back to 0 in the previous script re-enables the Restart option in the device.