I have created an exam environment user interface script that also kills the explorer task and removes task manager etc.. however you are able to close the UI using ALT+F4 and once you have done this you can't do anything at all (not even log off). You have to manually reboot the machine.
Is it possible to disable ALT+F4 for a security group? I wan't to avoid regedit unless it can be used for a security group on its own and doesn't affect the machine after the exam user is logged off.
Any help appreciated.
Probably best to make the application the shell, then it should reopen should they close it. Also that way explorer never runs.
Doable using GPO/GPP
No, it is not. Alt-F4 is the windows shortcut key for closing an application, it is handled by the application and can only be disabled by a specific application.
What I suggest is instead of running your "exams" software directly, create a batch file that runs the exams software using start /wait and then afterwards run logoff.exe to log off the user. Oooor you could write a batch file with a never-ending loop which runs the application again if it is executed.
The run this batch file instead.
That's a good idea, at the moment I have a batch script that runs on logon and a kix sctipt that starts the software and kills explorer.exe so maybe an if statement for if the file is closed it should run again?
Im not a kix expert but im sure you can make the kix script wait for the program to finish executing when you run it somehow.
Originally Posted by ChristianDavies
I'll have a look into it tomorrow morning, might be back :)
It's really easy to completely disable Alt + F4 with the following AutoHotkey script.
If you compile the script to an EXE (right-click the AHK file » Compile Script), all you have to do is run it when the users login and they won't be able to close any programs with Alt + F4. :)
Originally Posted by Arthur
Nice! Good one m8. I assume it blocks the windows message chain or something? Probably need to run this 1st?
Yeah. As long as the script is running, the key combo gets intercepted.
Originally Posted by ChrisMiles
You only have to install AutoHotkey on your PC in order to compile the .ahk script into an EXE. Once that is done, it can be run via a login script, the HKLM 'Run' key below, or another method.
Originally Posted by ChrisMiles
Another way to disable Alt + F4 would be to modify the keyboard scan code map in the registry on each PC they are doing exams on. The following .reg file and PowerShell script both do this, although you could also use Group Policy Preferences to deploy the Scancode Map.
Windows Registry Editor Version 5.00
; Disable Left & Right ALT keys and F4
These will disable Alt + F4 for every user who logs onto that PC. For the changes to take effect, reboot the computer.
# Disable Left & Right ALT keys and F4
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -name "Scancode Map" -Value ([byte](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x38,0xe0,0x00,0x00,0x00,0x00))
To re-enable Alt + F4 simply delete the "Scancode Map" registry value and reboot again.
Brilliant! It works!
Just added a line in my VB Script that says: