Reputation: 75650
I am maintaining an old Classic ASP site for a friend that is hosted on a cheap shared host. They are getting errors that will be solved with an Application Pool recycle.
However, the hosting control panel doesn't have any sort of options to recycle the app pool and the hosting company themselves are non-responsive to support requests.
Is there any way to cause IIS to recycle the app pool from ASP itself? Can I change something in the global.asa or anything that would trigger a recycle? I have FTP access and that is about it.
UPDATE: PROBLEM SOLVED
@Schotime's answer was right on. His code was in asp.net, I thought I would post the VBscript equivalent code that I found on aspfaq.com
<%
Sub Touch(FolderPath, FileName, NewDate)
Set app = CreateObject("Shell.Application")
Set folder = app.NameSpace(FolderPath)
Set file = folder.ParseName(FileName)
file.ModifyDate = NewDate
set file = nothing
set folder = nothing
set app = nothing
End Sub
Call Touch(Server.MapPath("/"), "somefile.htm", "2005-09-01")
Call Touch("C:\", "somefile.txt", "2012-01-01")
%>
Upvotes: 3
Views: 3015
Reputation: 15987
If you change the global.asa (eg. add a space) it will trigger a restart. I do it through code from ASP.NET at the moment.
File.SetLastWriteTime(HttpContext.Current.Server.MapPath("~/global.asa"), DateTime.Now);
Upvotes: 4