Allow asp in Win2003 automatically?

A

Ariel Erlijman

Hello,

How can Allow ASP in Win2003 in a script or some automatic way to be run in
my installer?

Regards,
Ariel
 
H

Hernan de Lahitte

Check out this code if it helps you.
You can call this method like this: EnabledExtension("aspnet_isapi.dll")


public static void EnabledExtension(string fileNameExtend)
{

string scriptPath = Environment.SystemDirectory;
string webExtension =
System.IO.Path.Combine(System.IO.Path.Directory.GetParent(HttpRuntime.Machin
eConfigurationDirectory).ToString(), fileNameExtend);

ProcessStartInfo pInfo = new ProcessStartInfo("cscript");
pInfo.Arguments = String.Format("iisext.vbs /EnFile {0}",webExtension);

try
{
using(Process p = Process.Start(pInfo))
{
string info = p.StandardOutput.ReadToEnd();
if (!p.WaitForExit(60000))
// Log timeout message
}
}
catch(Exception ex)
{
// Log ex
}
}


--
Hernan de Lahitte
Lagash Systems S.A.
http://weblogs.asp.net/hernandl
Shadowfax Dev Team

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top