Problem with Process.Start()

  • Thread starter Jason Barnard via .NET 247
  • Start date
J

Jason Barnard via .NET 247

I'm having trouble getting a non-microsoft program to start using this method. I've had success with notepad and other MS stuff.

I get the error "The parameter is incorrect". I've double checked the paths and file names.

Process myProcess = new Process();
myProcess.StartInfo.FileName = @"C:\\FORMFLOW\\DFFILL.EXE";
myProcess.StartInfo.Arguments = @"C:\\FORMFLOW\\FAP\\AMEDD.FAL";
//myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.Verb = "Open";
myProcess.Start();
//Do some SendKeys stuff


Thanks
 
N

Nicholas Paldino [.NET/C# MVP]

Jason,

I can see two problems. The first is the strings you are using:

myProcess.StartInfo.FileName = @"C:\\FORMFLOW\\DFFILL.EXE";
myProcess.StartInfo.Arguments = @"C:\\FORMFLOW\\FAP\\AMEDD.FAL";

Those strings have escape sequences in them, and they are considered
literals. Use one or the other, not both:

myProcess.StartInfo.FileName = "C:\\FORMFLOW\\DFFILL.EXE";
myProcess.StartInfo.Arguments = "C:\\FORMFLOW\\FAP\\AMEDD.FAL";

OR

myProcess.StartInfo.FileName = @"C:\FORMFLOW\DFFILL.EXE";
myProcess.StartInfo.Arguments = @"C:\FORMFLOW\FAP\AMEDD.FAL";

The second is the Verb property. If your program isn't registered as
having this verb, then it might not work (but I dont know how your program
is registered on the system, so I couldn't tell you).

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top