Greetings to all,
I really appreciate the support from this community and I've made some
advancements, but again I'm hitting a wall...
I'm trying to write a program in C# that passes an option to another EXE so
that the second program knows what to do.
I belive the syntax is like below, but the problem arises when I add the
option; it does not find the exe file.
System.Diagnostics.Process.Start("c:\program files\program\sample.exe"
/option:"doSomething");
As a test, I tried "Run" option of Windows as below:
"c:\program files\program\sample.exe" /option:"doSomething"
and this works fine.
I'm puzzled as to what the problem is.
What am I doing wrong?
Thanks very much for your help!
Cheers,
Takuya 7 1114
Remember the syntax of strings in C#. I think you want to type this:
System.Diagnostics.Process.Start(
"\"c:\\Program FIles\\Program\\Sample.exe\" /option:\"doSomething\"");
That is, put \ before every \ or " that occurs within a string.
"Takuya Matsumoto" <ad*************************************@sakaecorp .co.jp> wrote in message news:%2******************@TK2MSFTNGP11.phx.gbl... Greetings to all, I really appreciate the support from this community and I've made some advancements, but again I'm hitting a wall... I'm trying to write a program in C# that passes an option to another EXE so that the second program knows what to do. I belive the syntax is like below, but the problem arises when I add the option; it does not find the exe file. System.Diagnostics.Process.Start("c:\program files\program\sample.exe" /option:"doSomething"); As a test, I tried "Run" option of Windows as below: "c:\program files\program\sample.exe" /option:"doSomething" and this works fine. I'm puzzled as to what the problem is. What am I doing wrong? Thanks very much for your help! Cheers, Takuya
> Remember the syntax of strings in C#. I think you want to type this: System.Diagnostics.Process.Start( "\"c:\\Program FIles\\Program\\Sample.exe\" /option:\"doSomething\"");
That is, put \ before every \ or " that occurs within a string.
Woops, my typing mistake.
I had actually done so.
Cheers,
Takuya
<irrelevant newsgroups removed>
"Takuya Matsumoto" <ad*************************************@sakaecorp .co.jp>
wrote in message news:%2******************@TK2MSFTNGP11.phx.gbl... Greetings to all,
<snipped>
I'm trying to write a program in C# that passes an option to another EXE
so that the second program knows what to do. I belive the syntax is like below, but the problem arises when I add the option; it does not find the exe file.
System.Diagnostics.Process.Start("c:\program files\program\sample.exe" /option:"doSomething");
<snipped>
Cheers,
Takuya
The Process class' "Start" method has an override specifically for supplying
arguments to the executable being started. In your case, the syntax would
be:
System.Diagnostics.Process.Start("C:\\Program Files\\Program\\Sample.exe",
"/option:\"doSomething\"");
Good luck.
--
Ryan LaNeve, MCSD.NET http://weblogs.asp.net/rlaneve
hi,
i think you can also put an @ before your string, then the echap char would
be automatic.
@"c:\program files\program\sample.exe" would work i suppose.
ROM
"Michael A. Covington" <lo**@www.covingtoninnovations.com.for.address> a
ecrit dans le message de news: #X**************@TK2MSFTNGP12.phx.gbl...
Remember the syntax of strings in C#. I think you want to type this:
System.Diagnostics.Process.Start(
"\"c:\\Program FIles\\Program\\Sample.exe\" /option:\"doSomething\"");
That is, put \ before every \ or " that occurs within a string.
"Takuya Matsumoto" <ad*************************************@sakaecorp .co.jp>
wrote in message news:%2******************@TK2MSFTNGP11.phx.gbl... Greetings to all,
I really appreciate the support from this community and I've made some advancements, but again I'm hitting a wall...
I'm trying to write a program in C# that passes an option to another EXE
so that the second program knows what to do. I belive the syntax is like below, but the problem arises when I add the option; it does not find the exe file.
System.Diagnostics.Process.Start("c:\program files\program\sample.exe" /option:"doSomething");
As a test, I tried "Run" option of Windows as below: "c:\program files\program\sample.exe" /option:"doSomething" and this works fine.
I'm puzzled as to what the problem is. What am I doing wrong?
Thanks very much for your help!
Cheers,
Takuya
I don't have it in front of me, but I was pretty sure that there is an
overload for process.start that allows you to pass a command line argument.
It's not all passed as one string. The overloads second parameter is an
object array if I remember correctly.
Phil
"Takuya Matsumoto" <ad*************************************@sakaecorp .co.jp>
wrote in message news:%2******************@TK2MSFTNGP11.phx.gbl... Greetings to all,
I really appreciate the support from this community and I've made some advancements, but again I'm hitting a wall...
I'm trying to write a program in C# that passes an option to another EXE
so that the second program knows what to do. I belive the syntax is like below, but the problem arises when I add the option; it does not find the exe file.
System.Diagnostics.Process.Start("c:\program files\program\sample.exe" /option:"doSomething");
As a test, I tried "Run" option of Windows as below: "c:\program files\program\sample.exe" /option:"doSomething" and this works fine.
I'm puzzled as to what the problem is. What am I doing wrong?
Thanks very much for your help!
Cheers,
Takuya
Yes, Phil!
It worked perfectly.
Thanks very much for your help!
Cheers,
Takuya
"Phil Swartzell" <ps*********@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... I don't have it in front of me, but I was pretty sure that there is an overload for process.start that allows you to pass a command line
argument. It's not all passed as one string. The overloads second parameter is an object array if I remember correctly.
Phil
"Takuya Matsumoto"
<ad*************************************@sakaecorp .co.jp> wrote in message news:%2******************@TK2MSFTNGP11.phx.gbl... Greetings to all,
I really appreciate the support from this community and I've made some advancements, but again I'm hitting a wall...
I'm trying to write a program in C# that passes an option to another EXE so that the second program knows what to do. I belive the syntax is like below, but the problem arises when I add the option; it does not find the exe file.
System.Diagnostics.Process.Start("c:\program files\program\sample.exe" /option:"doSomething");
As a test, I tried "Run" option of Windows as below: "c:\program files\program\sample.exe" /option:"doSomething" and this works fine.
I'm puzzled as to what the problem is. What am I doing wrong?
Thanks very much for your help!
Cheers,
Takuya
Thanks Ryan,
It worked great the way you specified it.
Cheers,
Takuya
"Ryan LaNeve" <ry**@nolanevespam.com> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl... <irrelevant newsgroups removed> "Takuya Matsumoto"
<ad*************************************@sakaecorp .co.jp> wrote in message news:%2******************@TK2MSFTNGP11.phx.gbl... Greetings to all,
<snipped>
I'm trying to write a program in C# that passes an option to another EXE so that the second program knows what to do. I belive the syntax is like below, but the problem arises when I add the option; it does not find the exe file.
System.Diagnostics.Process.Start("c:\program files\program\sample.exe" /option:"doSomething");
<snipped>
Cheers,
Takuya
The Process class' "Start" method has an override specifically for
supplying arguments to the executable being started. In your case, the syntax would be: System.Diagnostics.Process.Start("C:\\Program Files\\Program\\Sample.exe", "/option:\"doSomething\"");
Good luck. -- Ryan LaNeve, MCSD.NET http://weblogs.asp.net/rlaneve
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Matthew Robinson |
last post by:
i read a tutorial the other day on passing variables between php pages
using a html form and setting the action to the php page to parse, can
anybody see anything wrong with the code below? the...
|
by: bateman |
last post by:
Hi, I have a rather puzzling problem, have asked the ASP experts at work with
no joy and its driving me mad! I'll explain the steps in more detail below
but the general problem is I am manually...
|
by: Kevin Lyons |
last post by:
Hello,
I am trying to get my select options (courses) passed correctly from
the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html
I am having difficulty getting the...
|
by: Max |
last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong
here as I'm not able to pass a simple variable to a function.
In the head of doc I have:
<script...
|
by: Catherine Jones |
last post by:
Hi all, we need urgent help in a matter.
We are trying to pass a COM object from the client to server and are
facing some problems in the same.
We've our client in C# as well as the Server...
| |
by: Gr8North |
last post by:
I'm relatively new to .Net, and would appreciate a little assistance.
I have multiple datasets attached to individual grids on individual tabs on
a form.
I would like to have a series of...
|
by: dice |
last post by:
Hi,
In order to use an external api call that requires a function pointer I
am currently creating static wrappers to call my objects functions.
I want to re-jig this so I only need 1 static...
|
by: The Doctor |
last post by:
A rather elementary question, In VB5, how can I pass a
variable from one form to another?
|
by: kennthompson |
last post by:
Trouble passing mysql table name in php. If I use an existing table
name already defined everything works fine as the following script
illustrates.
<?php
function fms_get_info()
{
$result =...
|
by: jej1216 |
last post by:
I am trying to put together a PHP search page in which the user can select none, one, two, or three fields to search, and then the results php will build the SQL with dynamic where caluses to reflect...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |