Trouble with Process.Start

  • Thread starter Thread starter Matt F
  • Start date Start date
M

Matt F

I have a relatively long command that I'm attempting to get process.start to
execute.

When executing the command, I get a "The system cannot find the file
specified" error. I've gone to the trouble of making sure the entire
command is fully qualified etc. but the error still occurs.

Here is the command (modified slightly of course)
C:\Dev\[solution name]\[project name]\bin\Debug\[exe name to run].exe
/silent /type 1 /constr "Data Source=[sql express instance];Initial
Catalog=[catalog name];Persist Security Info=True;User ID=sa;pwd=[password]"
/destination C:\Dev\[solution name]\[project name]\bin\Debug\Data\[filename]
/destpwd [password]

Note that everything within [] has been modified for post.

Also note: pasting the unaltered version of this to a dos command window
works exactly as I would expect it to.
 
This was also posted (by me) to the micorosoft.public.dotnet.languages.vb
group --- posted here at the request of msdn online concierge due to trouble
with my newsgroup reader. Sorry for the inconvenience.
 
Hi Matt,

Yes, just as Cor pointed out, the other components after the "[exe name to
run].exe" are command line arguments, so they should not be passed as the
"filename" parameter of Process.Start(). There is a overloaded version of
Process.Start(), which takes argumeents as the second parameter:

Public Shared Function Start ( _
fileName As String, _
arguments As String _
) As Process

returnValue = Process.Start(fileName, arguments)

So, You may pass them as the second parameter of Process.Start() method.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top