As http is a stateless protocol,
You never know when the window was closesd.Because server will always identify each request as unique request and if you are using session variables,it will recognise the closing of browser after 20 default minutes(It could be more) because there is not going to be any request for that Browser ID(A small per session cookie does it)
Well you can never mingle client side activities like losing of browser with server side activity like deleting files using FSO-File System Object.You have to justify the event when you want to delete files.
Well there is a way to trap script timeout through MTS.
So using MTS you can dfine timelimit(Default it offers 60 minutes),you can search google or microsoft.com for the script.
And if it is timing out,you can do some action like deleting of files using FSO.
In the second para maybe I am out of track but because i have not understood the second requirement.
Rushi Shroff Rushi@emqube.com
"Life is beautiful."