Can perl.exe handle unquoted paths containing spaces on the command line? Try to specify the path:
myProcessStartInfo.Arguments = @"""C:\Documents and Settings\test_perl.pl""";
Since the command line arguments are separated by spaces, unless the file path is specified, the application (perl.exe, in this case) will see three arguments:
- C: \ Documents
- and
- Settings \ test_perl.pl
Perl will most likely try to open the file "C: \ Documents". Of course, this does not exist. The solution is to specify file paths that contain spaces (or all file paths to be sequential).
You note that notepad.exe handles unquoted file paths very well. This is probably just a notepad smarter than the average bear and merging its arguments for you.
And make sure the file exists on this path, of course. This is actually a little unusual way; usually you will see user files in the form C: \ Documents and Settings \ myusername \ Documents \ file.ext or such.
source share