Solved

Exception Details: System.ComponentModel.Win32Exception: Access is denied

Posted on 2007-04-04
7
6,320 Views
Last Modified: 2011-09-20
Hi people.

i have a rather annoying problem.  I am trying to execute an exe called PDF2SWF from a .net dll whch in turn is being called from a webpage.  This is the code i am using to call it

private string ConvertToSwf(string filename, string appPath)
{            
      string swfName = "";
      try
      {
            FileInfo file = new FileInfo(filename);
            string arguments = "\"" + file.FullName + "\"";
            swfName = Path.Combine(m_outputPath, Path.GetFileNameWithoutExtension(file.Name) + ".swf");
            arguments += " \"" + swfName + "\"";
               
            ProcessStartInfo procStart = new ProcessStartInfo(appPath, arguments);

            procStart.UseShellExecute = true;
            procStart.WindowStyle = ProcessWindowStyle.Hidden;
            Process console = new Process();
            console = new Process();

            console.StartInfo = procStart;
            console.Start();

            console.WaitForExit();
            console.Close();
            console.Dispose();
      }
      catch (Exception ex)
      {
            CLogger.AddLogEntry("Unable to load Thumb Generator : " + ex.ToString());
      }
      return swfName;
}

when i try to execute the exe directly from the DLL i et no errors it just doesnt work, however when i try to execute a batch file from the dll which in turn calls the exe i get this error:

System.ComponentModel.Win32Exception: The system cannot find the file specified

Note:

The strange thing is that at one point it did work, no problem, but i was having other problems so i had the change the code, but by fixing that i seemed to have broken this - the fix wasnt related t ths but it still refuses to work.

Any ideas?
0
Comment
Question by:apresto
  • 3
  • 2
7 Comments
 
LVL 9

Expert Comment

by:sun4sunday
ID: 18849494
have a look on this
http://support.microsoft.com/?id=329291

sun4sunday
0
 
LVL 23

Author Comment

by:apresto
ID: 18849755
Thanks for the reply,  But i dont understand, the link explains something different, im not trying to write to the event log - i googled and found that yesterday too
0
 
LVL 23

Author Comment

by:apresto
ID: 18850644
I fixed my problem i will ask for a delete
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 9

Expert Comment

by:sun4sunday
ID: 18855515
If you can share the solution, it will help for all and you can ask for a refund.
sun4sunday
0
 
LVL 23

Author Comment

by:apresto
ID: 18990694
i had unregistered my dll and not re registered - i believe this was the problem anyway
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 19229759
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now