Dears
I have created the following bookmark in IE 11:
javascript:(
function george()
{
var script = document.createElement('script');
script.type='text/javascript';
script.onload = function() {georgeee()};
script.src = 'http://mycompany/measurement.js'+
Math.floor((new Date).getTime()/3600000000);;
document.body.appendChild(script);
}
)();
measurement.js contain the following:
javascript:(function georgeee()
{
var oShell = new ActiveXObject("WScript.Shell");
var oExec = oShell.Exec
(
'powershell.exe -Command " & { $port= new-Object System.IO.Ports.SerialPort COM1,9600,None,8,one ; $port.open() ; $port.ReadLine() ; $port.Close() ; [Environment]::Exit(1) } "'
);
Output = oExec.StdOut.ReadAll();
var substroutput = Output.substr(8,5);
document.getElementById('measureSrcContainer&# 39;).value = substroutput;
})();
But it is not working though putting the code of measurement.js directly in the bookmark it is working.