Forum Moderators: open
When users close the broswer I want to run the following dos command: rasdial myVPN /disconnect
I have found the window.close event documented in the dhtml ref but cant figure out how to use it as an event handler to run some code.
Thanks.
Just I think so.
<script language=JavaScript>
function logoff ()
{
var shell = new ActiveXObject("WScript.Shell");
shell.run ("cmd.exe rasdial myVPN /disconnect");
window.close();
}
</script>
<body onload="return logoff();"></body>
leniz, It can be done safely using custom IE security levels and trusted sites. A tip - never connect to the web using an account that has permission to format c. Most exploits run under the logged on users account.