Unknown Error on Process.start

I am getting an Unknown Error message when calling process.start.  My code is below.  I have copy and pasted the filename into the Run prompt and IE does launch so I know that is valid, I have also pasted from the clipboard into the address bar and the URL is valid.

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.EnableRaisingEvents = false;
process.StartInfo.FileName = @"C:\Program Files\Internet Explorer\iexplore.exe";
process.StartInfo.Arguments = url;
Clipboard.SetDataObject(url);
process.Start();


I do have a try/catch around the code, and there is no inner exception.  The error message I get is "Unknown error 0xffffffff".  This is running in a desktop app, and used to work.  I don't know what has changed on the computer in the last 3 months to make it not work, but the code did not change.
LVL 4
SkipFireAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
AlexFMConnect With a Mentor Commented:
Try to run directly URL:
process.StartInfo.FileName = url;

This will work like ShellExecute, running program associated with file name. For URL, this is Windows Explorer.
0
 
Shakti109Connect With a Mentor Commented:

Have you applied any service patches or operating system updates to the system(s)?

A change in security (or tightening of security policy) will definately affect your ability to do external program launches.


In effect, you are doing what a web pop-up does.
To test and see if it is limited to internet explorer you could try :

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.EnableRaisingEvents = false;
process.StartInfo.FileName = @"C:\windows\system32\calc.exe";
process.Start();

If calc.exe (the system calculator) works and the call to internet explorer does not, you may have a problem with the security settings.

If calc.exe does NOT work, there may be a system policy preventing launching of applications BY an application without some kind of impersonation or security rights.
0
 
SkipFireAuthor Commented:
AlexFM - your suggestion did function, however it pops up in the already open window, I need it to open into a new window which is what happens when you do "iexplore <url>".
Shakti109 - I still get unknown error with calc.  How can I determine if it is a policy change?  I have not changed the policy on my machine, but the domain admins could have pushed out a new policy to the domain.

Still need help on this one, but thanks for the help so far guys.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Shakti109Commented:


I have tried this (opening the calculator) under several user contexts on a test machine and am able to fire up the calculator process under all of them.


Hrm...When you say "unknown error", is that what the error text says?

0
 
SkipFireAuthor Commented:
The error text is unknown error.
0
 
SkipFireAuthor Commented:
The code is now executing without me having changed anything.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.