1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

nshsを自動起動

Last updated at Posted at 2015-01-12
nshs.js
var URL  = "https://www.deal.matsui.co.jp/ITS/login/MemberLogin.jsp";
var ID     = "会員ID";
var PASS = "会員パスワード";
var tPSS  = "取引暗証番号";   //簡単注文を設定しない場合は空で
/*-----------------------------------------------------------------*/

var wsh = new ActiveXObject("WScript.Shell");

//var IE = new ActiveXObject("InternetExplorer.Application")
//→ UACオンにしたら→80010108,「起動されたオブジェクトはクライアントから切断されました。」
//で
//Registry Editorで以下追加
//[HKEY_CLASSES_ROOT\InternetExplorer.ApplicationMedium] 
//[HKEY_CLASSES_ROOT\InternetExplorer.ApplicationMedium\CLSID] 
//@="{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}"
var IE = new ActiveXObject("InternetExplorer.ApplicationMedium");

IE.Navigate(URL);
IE.visible = true;

isIEbusy();
IE.document.form.clientCD.value = ID;
IE.document.form.passwd.value = PASS;
IE.document.form[(tPSS ? 4 : 3)].click();
IE.document.form.submit();

isIEbusy();
if(tPSS){
  IE.document.form.pinNo.value = tPSS;
  IE.document.form.submit();
  isIEbusy();
}

var frames = IE.Document.getElementsByTagName("frame");
for(var j in frames){
  if(frames[j].name =="LM"){
	var anodes = frames[j].contentDocument.getElementsByTagName("a");
	for(var k in anodes){
		if(anodes[k].textContent =="ネットストック・ハイスピード"){
			break;
		}
	}
  }
}
anodes[k].click();

isIEbusy();
var frames = IE.Document.getElementsByTagName("frame");
for(var j in frames){
  if(frames[j].name =="CT"){
	var anodes = frames[j].contentDocument.getElementsByTagName("a");
	for(var k in anodes){
		if(anodes[k].hasChildNodes()){
			if(anodes[k].firstChild.alt =="起動する") break;
		}
	}
  }
}
anodes[k].click();

function isIEbusy(){
	for(var i=0; i<1000; i++){
		WSH.Sleep(100);
		if(IE.busy != true && IE.ReadyState	==4) return;
	}
	if(IE.document == null) {
		WSH.Quit(WSH.echo(IE.document+"を作成できません"));
	}
}

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?