VBAHole22 Posted October 22, 2004 Posted October 22, 2004 I have a win app working that uses Process and ProcessStartInfo to fire off a program from the dos command prompt. It works great but now I need to get it to work from an ASP.NET web page or from an ASP.NET web service and I cannot get either to work. It looks like the process is executed but the results are not there. I tried impersonating in case it was a permissions issue and it didn't help. The only thing I can think of is that the process object is somehow crippled in asp.net for security reasons or something. But shouldn't I be able to get around this? Function aProcess(ByVal Arg As String) As String Dim ps As New ProcessStartInfo Dim p As New Process Try ps.FileName = "cmd.exe" ps.Arguments = Arg ps.UseShellExecute = True p.StartInfo = ps p.Start() p.Close() Return "Success" Catch ex As Exception Return ex.Message End Try End Function Quote Wanna-Be C# Superstar
Administrators PlausiblyDamp Posted October 22, 2004 Administrators Posted October 22, 2004 The application will run, however it will run on the asp.net server and only with the permissions granted to the ASPNET user account. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VBAHole22 Posted October 22, 2004 Author Posted October 22, 2004 Even with impersonate on? I thought it would run under the impersonated account? Is it not doing that because it is on another thread or something? I have tried asp.net web services, and straight asp.net and no luck. Now I am on to Windows service. Does anyone know how to call a windows service and pass in parameters? If I google for '.net windows service' I get the same tired sample on 6 different websites, that stinks. :( Quote Wanna-Be C# Superstar
Joe Mamma Posted October 23, 2004 Posted October 23, 2004 1. change your Win App to a ServicedObject, 2. load it in COM services 3. give ASPNET permission to launch it 4. Rewrite your win app to call the serviced object* 5. Done * this is optional, but it allows for a single functional unit used by your asp as well as your win. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.