There are different ways to shut down the system, so you have to take that into account in order to avoid the issue entirely.
1. Make sure the user accounts you want to restrict are logged off.
2. Log on with an administrator account, and open an elevated command prompt.
Disable all shut down buttons and menus for a specific user
1. Type or paste the following command in the command prompt by replacing <User> with the actual folder, then press Enter:
- reg load “HKU\User” “%SystemDrive%\Users\<User>\NTUSER.DAT”
- reg add “HKU\User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer” /v “NoClose” /t REG_DWORD /d 1 /f
- reg unload “HKU\User”
Revoke shut down privileges assigned to standard users
1. Download the Windows Server 2003 Resource Kit Tools.
2. Extract the downloaded rktools.exe file using 7-Zip.
3. Open the folder containing the extracted files, and extract the rktools.msi using 7-Zip. Among all the files there is one called ntrights.exe.
4. Navigate to the folder containing ntrights.exe by running the commands below (after replacing the folder path inside quotes):
- cd /d “X:\Some\folder”
- ntrights.exe -u Users -r SeShutdownPrivilege
- ntrights.exe -u Users -r SeRemoteShutdownPrivilege
Execute this command:
- reg add “HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System” /v “ShutdownWithoutLogon” /t REG_DWORD /d 0 /f