Solved

unable to call executable from webservice

Posted on 2007-04-03
2
736 Views
Last Modified: 2008-02-01
This has me and my team really stumped, and so we could use some help. We want to call an external program from a webservice, but it doesn't seem to find the apps, saying file not found. I've followed the examples in VSNET.2003. The program is C#.net. Here's the snippet:

                        System.Diagnostics.Process proc;
                        Process p = new Process();
                        p.StartInfo.WorkingDirectory =
                        "C:\\Program Files\\Microsoft Visual FoxPro 8";
                        p.StartInfo.FileName = "vfp8.exe";
                        p.StartInfo.Arguments = "c:\\dbflock\\rlock.prg";
                        p.StartInfo.UseShellExecute = false;
                        p.StartInfo.RedirectStandardOutput = true;
                        p.Start();
                        p.WaitForExit();


I calls a foxpro executable in the c:\dbflock subdiretory.  I've tried moving the exe to different places (haven't tried system32), added that directory to the path statement, tried this idea:
System.Diagnostics.Process proc;
                        proc = System.Diagnostics.Process.Start(@"c:\DBFLOCK\RLOCK.EXE", arg1);
                        proc.WaitForExit();


Can you think of another way to start an external executable from a web service? Thanks for any help!
0
Comment
Question by:andremara
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Niraj_Singh earned 500 total points
ID: 18848715
hi,
 the file is opened by the aspnet user. this aspnet user does not have sufficient rights to open all file. you may have to give it the required rights.
also refer to the below mentioned link
http://www.code-magazine.com/article.aspx?quickid=0703062&page=2
0
 

Author Comment

by:andremara
ID: 18848758
Hi Niraj,
I think the article is calling .net from fox, where I am starting off in a webservice and would like to call an executable - in this case - foxpro, but possibly other exe's as well. when i run this, "File Not Found" is the error.  Are you saying this could be a rights issue and not a 'file not found' issue?
Thanks
Andre
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question