In the "Control Panel > Ease of Access Centre > Make the keyboard easier to use" is an option to "Underline keyboard shortcuts and access keys."

Is there a way of programmatically switching this on and off?
I'm using Visual Basic Scripts, but can use .NET.
['https://Stackoverflow.com/questions/1328078', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1726/']
1. Run Registry Editor and go to HKEY\_CURRENT\_USER\Control Panel\Accessibility\Keyboard Preference
2. Now create or modify a String Value (REG\_SZ) called On and set its value to 1

Information is comming from:
<http://www.windowsvalley.com/get-underlined-keyboard-shortcuts-and-access-keys-permanently/>
AFAIK, there's no way to toggle this option programmatically except for automating the approproate GUI actions (opening the Control Panel, switching the option on/off and applying the changes). In this case, I'd recommend using [AutoIt](http://www.autoitscript.com/autoit3/index.shtml) to automate the option switching.