tshm
2/23/2015 - 3:58 AM

jscript / bat template

jscript / bat template

@if(0)==(0) ECHO OFF
start wscript.exe //nologo //E:JScript "%~f0" %*
GOTO :EOF
@end

var ws = WScript.createobject('wscript.shell');
var getXmlHttp = (function() {
  if (undefined != XMLHttpRequest) {
    return function() {
      return new XMLHttpRequest();
    };
  } else {
    return function() {
      return new ActiveXObject("Microsoft.XMLHTTP");
    };
  }
})();

ws.Exec("control desk.cpl")
WScript.Sleep( 1000 );
ws.SendKeys("%l")
WScript.Sleep( 500 );
ws.SendKeys("%a")
WScript.Sleep( 500 );
ws.SendKeys("{ESC}");