all groups > dotnet academic > june 2004 >
You're in the

dotnet academic

group:

Problem with System.Diagnostic.Process.Start()...


Problem with System.Diagnostic.Process.Start()... twytswys NO[at]SPAM yahoo.com
6/23/2004 9:35:37 PM
dotnet academic: I am trying to run an external application from within my c#
application but keep running into this problem. Here's what I did:

System.Diagnostics.Process.Start( my.exe, parameters );

my parameters would consists of a path that has spaces in it (ie
C:\Program Files\a\b\c\temp.txt) The problem I run into is that
my.exe would run and exited immediately like the parameters is wrong.
In the DOS shell, when I do this:

C:\Temp\my.exe C:\Program Files\a\b\c\temp.txt

then I would reveive the wrong number of arguments error. But if I do
this:

C:\Temp\my.exe "C:\Program Files\a\b\c\temp.txt"

then my.exe would run perfectly. Now when I try to put in the
quotations around the path with the space in my c# app, I would get an
exception. Is this because of Process.Start() not functioning
Re: Problem with System.Diagnostic.Process.Start()... twytswys NO[at]SPAM yahoo.com
6/24/2004 9:53:20 AM
Just for the record. Process.Start() should not have any problem with
the spaces in parameters. I just put the quotes so that my.exe can
recognize it as one argument. The problem that I had was the path
that I enter is missing a character so the path did not existed.

[quoted text, click to view]
AddThis Social Bookmark Button