Welcome, guest | Sign In | My Account | Store | Cart

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:

Batch, 17 lines
 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();
Created by greg zakharov on Wed, 12 Dec 2012 (MIT)
Batch recipes (42)
greg zakharov's recipes (59)

Required Modules

  • (none specified)

Other Information and Tasks