I finally managed to get a VB script to work the way I wanted. Now it is time for a little cleanup. The gist of the script was to check for the presence of a keyboard. If someone removes the keyboard from the computer I display a little pop-up on the screen that the keyboard has been removed and then proceed to use devcon to disable some devices. The the keyboard is plugged back in the process reverses and via devcon re-enables the devices that were previously disables. Two "annoying" issues:
1) When I shell to devcon you actually see the window that devcon runs in displayed, Is there any way to supress the devcon windows so the user doesn't see anything?
2) The little windows that pops up displaying "keyboard removed" or "keyboard detected" does not always come to the forefront (it is behind other windows). Is there any way to force it to the forefront?