.NETGURU
Problem with System.Diagnostic.Process.Start()...
Messages   Related Types
This message was discovered on microsoft.public.dotnet.academic.

Post a new message to this list...

Laharl
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
correctly or my.exe is not written correctly? Thanks
Reply to this message...
 
    
Laharl
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.

Click here to reveal e-mail address (Laharl) wrote in message news:<Click here to reveal e-mail address>...
[Original message clipped]

Reply to this message...
 
    
Diane Orr
(Type your message here)

--------------------------------
From: Diane Orr

Dear Sir, I belive you are missing the "@" symbol.

For example:

System.Diagnostics.Process.Start(@"c:\nes\nes.exe"); actually opens up my nes.exe file in the folder C:\nes

Hope this helps
Reply to this message...
 
 
System.Diagnostics.Process




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification