Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running script from command line - access denied problem

Status
Not open for further replies.

miraclemaker

Programmer
Oct 16, 2002
127
GB
I've written a script that gets a piece of information from one of the Windows performance counters. I've set it up in a virtual directory and created a web.config file. This works just fine.

I've written a second script, as below and compiled it using csc.exe to allow me to run the first script from the command line.


Code:
using System;
using System.IO;
using System.Web;
using System.Web.Hosting;
public class MyExeHost : MarshalByRefObject {
public void ProcessRequest(String page) {
HttpRuntime.ProcessRequest(new SimpleWorkerRequest(page, null, Console.Out));
}
public static void Main(String[] arguments) {
MyExeHost host = (MyExeHost)ApplicationHost.CreateApplicationHost(typeof(MyExeHost), "/asp_dot_net_code", Directory.GetCurrentDirectory());
foreach (String page in arguments) {
host.ProcessRequest(page);
}
}
}

This compiles fine. I put it in the same directory as my first script and try and run it - before it will run it makes me copy the exe I just compiled and the first script into a directory called 'bin', which I do. Now when I try and run it I just get an access denied error. Can anyone help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top