Hello<BR><BR>I want the server to write some stat, kept in application varibles, to a text file when the server is shut down.<BR><BR>So I stuck the following code in the application_onend of the global.asa however when I shut my PWS down and start back up none of the data has been saved? I&#039m sure the code is ok, although a scan from a pair of fresh eye would be good, so I&#039m thinking that something must have gone wrong else where.<BR><BR>Any ideas? Feel free to email any answer to robotspin@aol.com as this boards so busy lately that this might have disappeared in a few hours ;) Thanks in advance.<BR><BR>Pete<BR><BR>And now the code :<BR><BR>&#060;SCRIPT LANGUAGE=VBScript RUNAT=Server&#062;<BR>SUB Application_OnEnd<BR> Dim fs<BR> Dim ServerFile<BR><BR> Set fs = CreateObject("Scripting.FileSystemObject")<BR> Set ServerFile = fs.OpenTextFile("c:/chainsaw/chainsaw/serverfile.txt", ForAppending, true)<BR> ServerFile.WriteLine "Stats for : " & Date()<BR> ServerFile.WriteLine "Games Played : " & Application("GamesPlayed") <BR> ServerFile.WriteLine "No. Visit : " & Application("VisitsToday")<BR> ServerFile.WriteLine "Visitor Total : " & Application("VisitTotal")<BR> ServerFile.WriteLine "Game Total : " & Application("GameTotal")<BR> ServerFile.WriteLine<BR> StatFile.Close<BR><BR> Set fs = CreateObject("Scripting.FileSystemObject")<BR> Set StatFile = fs.OpenTextFile("c:/chainsaw/chainsaw/statfile.txt", ForAppending, true)<BR> ServerFile.WriteLine Application("GamesPlayed") <BR> ServerFile.WriteLine Application("VisitsToday")<BR> ServerFile.WriteLine Application("VisitsYesterday")<BR> ServerFile.WriteLine Application("GamesYesterday")<BR> ServerFile.WriteLine Application("VisitTotal")<BR> ServerFile.WriteLine Application("GameTotal")<BR> ServerFile.WriteLine<BR> StatFile.Close<BR>END SUB<BR>&#060;/SCRIPT&#062;<BR>