I seem to have gotten myself into a major pickle. I have a lenovo w520 laptop and I tried to attach a keyboard. The keyboard wasn't being recognised properly. I removed all the keyboards from the device manager list and rebooted. At the login screen the USB keyboard worked fine, but after logging in, windows automatically seemed to install a ps/2 keyboard. I thought this was a mistake on windows part because it mis identified the USB keyboard. I now realise that it was probably installing the drivers for the onboard keyboard.
To prevent this automatic driver installation, I enabled the "Prevent Installation of Devices not described by other policy settings" group policy setting as described here
Now, after reboot at the login screen, windows doesn't recognise my laptop keyboard or mouse or the external keyboard. I am completely locked out of my system. I can alternate boot and get to a system recovery screen and use my keyboard and mouse. I can now get to a recovery console, but I don't know how I can undo the group policy setting from the command line.
Any other suggestions on how I can regain the keyboard and mouse without having to reinstall Windows?
Any help would be greatly appreciated.