IT administrators often find themselves in the position of needing to quickly retrieve the display resolution of a Windows computer from the command line. This can be a difficult task because the display resolution is stored in the registry, which can be difficult to navigate.
Fortunately, the Windows command line provides a simple solution for retrieving the display resolution for any given computer. The command line utility “wmic” can be used to access the Windows Management Instrumentation (WMI) which contains information about the computer’s hardware and software.
To get the display resolution, the wmic command “wmic path Win32_VideoController get CurrentVerticalResolution,CurrentHorizontalResolution” can be used. This will return the current vertical and horizontal resolution of the display in pixels. For example, if the resolution is 1920×1080, the command will return “1920 1080”.
The wmic command can also be used to get other information about the display, such as the manufacturer, model, driver version, etc. The command “wmic path Win32_VideoController get *” will return all the information about the display.
The wmic command can also be used to set the display resolution. To do this, the command “wmic path Win32_VideoController set CurrentVerticalResolution=1920,CurrentHorizontalResolution=1080” can be used. This will set the resolution to 1920×1080 or whatever resolution is desired.
The wmic command is a powerful tool for IT administrators, as it allows them to quickly and easily retrieve and set the display resolution of a Windows computer from the command line. This can be a critical tool for diagnosing and fixing display issues, as well as for setting up multiple computers with the same resolution.