≡ Menu

Get screen resolution from command prompt

We can find out desktop resolution of a computer from command prompt using wmic command. The below command prints desktop resolution for all the available monitors on the system.

wmic desktopmonitor get screenheight, screenwidth

Ex:

C:\>wmic desktopmonitor get screenheight, screenwidth
ScreenHeight  ScreenWidth
900           1440
900           1440
c:\>

The above output shows that there are two monitors connected to the computer, each having the resolution 900×1440.

The below is the output on another system connected to two displays having different resolutions.

c:\>wmic desktopmonitor get screenheight, screenwidth
ScreenHeight  ScreenWidth
900           1600
1080          1920
7 comments… add one
  • God

    Thanks for this! :)

  • Youssef Trabelsi

    i can’t use this command in Condition
    I mean than :
    If resolution do …
    elso do …
    it’s possible ?

    • admin

      You should be able to do this in a batch script by capturing the output of the wmic command in a variable and then check for it’s value.

  • SHEKHAR

    How to change screen resolution with cmd without using third party tools

    • admin

      Nothing as such I am aware of.

  • Vishnu

    Is there any command to duplicate the same display to the second monitor? or do vice-versa i.e Remove duplication and extend second display on the other monitor

  • Pratik Sonigra

    Can you please let me know how to change resolution using cmd?

Leave a Comment