Not possible in JavaScript. VBScript is only for IE and in any other browser it will not work.
Anyone who uses IE has no clue about Internet so it should only be your application for some bloated intranet website to control other applications in a very hoex'ed way.
Therefore i think you should just use VBScript and force all your intranet users to use the very insecure IE for it so that it works

Any other browser or language doesn't allow such things and i wonder how long it will take before M$ destroys VBScript.