Home > Mobile >  Open Display Settings or Run Dialog Box using Python
Open Display Settings or Run Dialog Box using Python

Time:08-24

How can I open RunDialogBox or Display settings using Python?

I found a way to open Display settings using Run Dialog box (Win R), just type in ms-settings:display.

With cmd you can type explorer.exe shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}, or with Powershell (New-Object -ComObject "Shell.Application").FileRun().

CodePudding user response:

One simple option is to run the cmd command from Python:

import subprocess
subprocess.run(['explorer.exe', 'shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}'])

As for the Display settings, that's also achievable in a similar way:

import subprocess
subprocess.run(['control.exe', 'desk.cpl'])
  • Related