In previous time I wrote how to do it with mshta.exe. Good, now I want to show you how to do it with COM-object htmlfile. It looks like similar way with mshta.exe:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | @set @script=0 /*
@echo off
set @script=
cscript //nologo //e:jscript "%~dpnx0"
exit /b
*/
var screen = {
getResolution : function() {
with (new ActiveXObject('htmlfile')) {
var scr = parentWindow.screen;
WScript.echo(scr.width + 'x' + scr.height);
}
}
};
screen.getResolution();
|
Tags: resolution, screen