Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows - Delete file on HTML close

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,
I guess I would do it with VBscript - how can I delete a certain file when my HTML gets closed ?

Thanks

Long live king Moshiach !
 
Is this on the server or the client?

Can you explain a little more of your needs - otherwise this sounds like malware, and you won't get any help on this forum for that!

When you sorted your needs, you will do better to post in the appropriate forum as you can't achieve this with HTML

Client side, try forum216 for Javascript or forum329 for VBScript

Server side, whichever language forum you want to use and your server supports (PHP, ASP etc etc)

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
HI,

I'm running on a standalone machine (client).
My HTML file includes some VBscript that creates some files in temp dir,for display purpose.
Once the user finished viewing the HTML,I want to cleanup the temp dir.
Thanks

Long live king Moshiach !
 
Well,

I guess I have created an interesting way of viewing customer logs by support...
I bring over from customer HTML log and a zip file.HTML has special links that work AFTER the zip file with a full blown logs is expanded to a temp dir.
So I want to cleanup this temp dir once the HTML is closed,it can be pretty big sometimes.
Thanks

Long live king Moshiach !
 
because the zip is activated by a VBscript from WITHIN my HTML file,thus the cleanup must also happen from HTML...

<script language=VBScript>
set objShell=CreateObject(\"Wscript.Shell\")
objShell.Run(\"unzip -o \"\"%userprofile%\\Desktop\\$ZIPNAME1\"\" -d c:\\TEMP\")

</script>


Long live king Moshiach !
 
Try re-reading my first reply to you.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
One thing you might want to look into is how to trigger the VBscript to do the delete. I don't know about VBscript but JavaScript has the following:
Code:
	window.onbeforeunload = function() {
		// Trigger the delete here.
	}
Which will run just before the page is unloaded (like from the upper left close X button). The onunload will only be triggered when the page is actually unloaded, and will not be called when the window is closed.


Einstein47
(For best results: hand wash in cold, tumble dry low. For not so good results: drag through puddles, pound on rocks, air dry on tree branch.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top