≡ 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
12 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?

  • Linfeng Li

    If the commands posted above does not work on Windows 10 machines, try the following

    wmic path Win32_VideoController get CurrentHorizontalResolution,CurrentVerticalResolution

    Reference: https://github.com/KittyKatt/screenFetch/issues/354

    • Frank

      thanks, this one worked for me

  • michael hernan

    I need to set my display resolution to 1024 x 768 . How do I do this in a straightforward manner?

  • Angela Whitmire

    Hey. I recently got a computer (Dell Inspiron with 15.6″ HD display) and I have it hooked up to a small tv, (Emerson 32″ -I think.) But I’m not able to find a command prompt to fit the resolution. I’m trying to learn this, but it’s not very easy to find books on coding and such.

  • sandeep nadipelli

    Is it possible to get the scaling dpi default on the windows VM?

Leave a Comment