-1

I am trying to create a simple script to turn off High contrast in Windows 10. I can't seem to a cmdlet for this so thought I could use the keyboard shortcut to turn the high contrast off (Left Alt + Left Shift + Print Screen).

I can only seem to find a way to send the keypress into a program, however it needs to be the OS which handles the keypress not a particular program. Does anyone know how I would do this?

Mr I
  • 23
  • 6
  • Possible duplicate of [How to send CTRL or ALT + any other key?](https://stackoverflow.com/questions/19824799/how-to-send-ctrl-or-alt-any-other-key) – Manu Nov 21 '17 at 10:47
  • thanks, I tried that solution but it doesnt seem to work. – Mr I Nov 21 '17 at 11:06

1 Answers1

0

You can instead apply a saved theme, which will include high-contrast settings as well. This has the benefit of not being as brittle as trying to simulate keyboard input:

  1. Save your theme
  2. Save it as a file by right-clicking it and selecting Save theme for sharing

    enter image description here

  3. Apply the theme by invoking the theme file:

    Invoke-Item C:\Documents\MyTheme.deskthemepack
    

(Taken from this answer)

Joey
  • 344,408
  • 85
  • 689
  • 683
  • Hello, thanks for your answer. The issue we have is that its a environment of around 30,000 machines so getting the custom theme on all the machines would be challenging without altering the base image (which is done yearly). But thank you for your response, I presume this is the only way to have this done in automated. – Mr I Nov 22 '17 at 08:55