我需要一个脚本来根据所使用的屏幕分辨率复制特定图像。
到目前为止,我发现 wmic desktopmonitor get screenheight
为我提供了适当的输出,但我无法将其解析为可用变量
问题是输出在三行上,我只需要第二行的信息。
有人能帮忙吗?
最佳答案
@Stephan's answer修改为与所有 Windows 版本(包括 Windows 8)兼容:
setlocal
for /f %%i in ('wmic path Win32_VideoController get CurrentHorizontalResolution^,CurrentVerticalResolution /value ^| find "="') do set "%%i"
echo your screen is %CurrentHorizontalResolution% * %CurrentVerticalResolution% pixels
关于windows - 获取屏幕分辨率作为cmd中的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25532444/