jessegavin
jessegavin

Reputation: 75650

How to force application pool to recycle in Classic ASP (not using IIS Management Console)?

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

Answers (2)

Schotime
Schotime

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

Dee
Dee

Reputation: 1420

no. ASP does not have system level access

Upvotes: 0

Related Questions