var objword = new ActiveXObject("word.application"); WScript.Echo("numlock key is on: " + objword.numlock); objword.quit();