Well - from the looks of it, this is more a Javascript question than anything else...
HOWEVER, let me just get this right before I continue - you are running a script, and you want to close the browser window as soon as it has finished?
If so - then the first thing to note is the syntax for your Javascript... it should read like this...
<script language="Javascript">
<!--
window.close();
//-->
</script>
The comment type tags around the window.close just hide the code from any browsers which don't run JS (very few now I grant you).
The problem you will probably experience with this, is that unless Javascript was responsible for opening the window (i.e. via window.open()😉 you will not be able to close the current window without a popup alert warning the user that JS is trying to close the window. This is an inherent security procedure to stop JS just closing all the windows in an explorer process, and as such it is not possible to circumnavigate this (unless you use signed code which must be marked as trusted by the client computer).
Anyhow - hope this helps