3,379 13 13 silver badges 25 25 bronze badges. REM You must have the proper graphics driver installed in your system. wmic desktopmonitor get Name,MonitorType,MonitorManufacturer. REM Detect Screen Resolution in Windows 7 - 10 - 32/64 bit compatible. ::wmic path Win32_VideoController get VideoModeDescription,CurrentVerticalResolution,CurrentHorizontalResolution /format:valueįor /f "tokens=* delims=" in ('wmic path Win32_VideoController get CurrentHorizontalResolution /format:value') do (įor /f "tokens=* delims=" in ('wmic path Win32_VideoController get CurrentVerticalResolution /format:value') do ( ::set "wmic_query=wmic desktopmonitor get screenheight, screenwidth /format:value"įor /f "tokens=* delims=" in ('wmic desktopmonitor get screenwidth /format:value') do (įor /f "tokens=2 delims=" %%# in do set "x=%%#"įor /f "tokens=* delims=" in ('wmic desktopmonitor get screenheight /format:value') do (įor /f "tokens=2 delims=" %%# in do set "y=%%#" This will print the resolutions of all monitors.Ī wmic script that will detect the version of windows and will use different wmi classes if needed: offįor /f "tokens=4,5 delims=. If you want I can add also a dpi resolution getter?Īnd if have more than one monitors I'll have to modify the script.Īnother way that will allow you to get resolution of more monitors is to use DxDiag (though it will create a temp file and will be slower ):įor /f "tokens=2 delims=:" %%a in ('find "Current Mode:" ~.txt') do ( With that said, the following is a list of WMIC queries that you can run on your Workstations/Servers. Feel enthusiast to enhance.With desktopmonitor you can get only dpi.For pixel resolution you need Win32_VideoController : offįor /f "delims=" %%# in ('"wmic path Win32_VideoController get CurrentHorizontalResolution,CurrentVerticalResolution /format:value"') do ( Start mstsc /admin /w:%ll% /h:%tl% /v:%srvnm%Įcho ^>^> Syntax: %0 MachineHostname Įcho ^>^> Sincerely Thank You For Using.įeel free to explore. Set i01=%i01% get screenHeight,screenWidthįor /f "delims= skip=1" %%o in ('type %o01%') do call :p01 %1 %%o Thank you :) With WMIC, I wrote Batch Script to Remote Desktop not full screen but still convenient. Some progress that even works on win 11 - not tried 7/8.x yet but should 'technically' work as just using the WMI Win32DesktopMonitor which appears to work from Vista and above - or so say m When a monitor driver is installed via OS/WU/Manually and detected then the GUI QT will scan the driver hashtable for a Manufacturer if possible. Use IPHost Network Monitor to monitor your servers, domains, computers and devices. IPHost Network Monitor is an advanced and easy tool for monitoring LAN and WAN networks, network servers, workstations and TCP/IP devices. ::wmic path Win32_VideoController get VideoModeDescription,CurrentVerticalResolution,CurrentHorizontalResolution /format:valueįor /f "tokens=* delims=" in ('wmic path Win32_VideoController get CurrentHorizontalResolution /format:value') do (įor /f "tokens=* delims=" in ('wmic path Win32_VideoController get CurrentVerticalResolution /format:value') do ( The WmiMonitorID WMI class represents the identifying information about a video monitor, such as manufacturer name, year of manufacture, or serial number. The Win32DesktopMonitor class represents the type of monitor or display device attached to the computer system. For the newer windows versions this can be used: wmic path Win32_VideoController get VideoModeDescription,CurrentVerticalResolution,CurrentHorizontalResolution /format:valueĪ script that checks the windows version and then gets the resolution with the wmic: offįor /f "tokens=4,5 delims=. ( wmic desktopmonitor get screenheight, screenwidth /format:value).This will not work on windows8/8.1/10. As for Win32VideoController, it's only for Vista . The ScreenWidth and ScreenHeight of the Win32DesktopMonitor WMI class will return the native res of a LCD (don't have a CRT around anymore to see if that tends to return sane values sadly). ago We are able to find the monitor ID via VGA by querying the registry. Try: 'wmic desktopmonitor get /format:htable > desktop\monitorinfo.html' You can also use /node:'pc-name-here' after wmic to remote access, eliminating your need for psexec. This will print the resolutions of all monitors.Įdit. Easily (WMI truly rocks for remotely getting infos like that). I don't think the PC is aware of it at all, especially if it's a VGA connection. With dxdiag though it is not the fastest way: offįor /f "tokens=2 delims=:" %%a in ('find "Current Mode:" ~.txt') do ( Perhaps a temporary text file? Solution 2 I'm not sure what tricks to use in order to use the output. Try this: wmic desktopmonitor get screenheight, screenwidthįrom within Cygwin: cmd /c wmic desktopmonitor get screenheight, screenwidth
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |