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.