473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Quotation marks in string arguments


My Windows service includes the following lines:

string Arguments3 = @"%OvAgentDir%\bin\OpC\cmds\ref-ovo-services.vbs
ServiceApplicatif ServiceOVO";
string expandedArguments3 =
Environment.ExpandEnvironmentVariables(Arguments3) ;
this.process3.StartInfo.Arguments = expandedArguments3;
this.process3.StartInfo.FileName = "cscript.exe";

ref-ovo-service.vbs runs with two arguments: ServiceApplicatif (windows
service) and ServiceOVO. Service applicatif can have a space in the
name.

My problem is to interger quotation marks on both sides of
ServiceApplicatif in the case of my Service Applicatif has a space.

\" on both sides of the command in this.process3.StartInfo.FileName =
"\"cscript.exe\""; works all right but not in string Arguments3

Thanks for any advices.
Bruno

Feb 3 '06 #1
2 6275
You need to use double double quotes (if you see what I mean) in verbatim
strings to represent a single double quotes.

"\"cscript.exe\""

but if prefixed with @,

"""cscript.exe""";

<bc*******@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...

My Windows service includes the following lines:

string Arguments3 = @"%OvAgentDir%\bin\OpC\cmds\ref-ovo-services.vbs
ServiceApplicatif ServiceOVO";
string expandedArguments3 =
Environment.ExpandEnvironmentVariables(Arguments3) ;
this.process3.StartInfo.Arguments = expandedArguments3;
this.process3.StartInfo.FileName = "cscript.exe";

ref-ovo-service.vbs runs with two arguments: ServiceApplicatif (windows
service) and ServiceOVO. Service applicatif can have a space in the
name.

My problem is to interger quotation marks on both sides of
ServiceApplicatif in the case of my Service Applicatif has a space.

\" on both sides of the command in this.process3.StartInfo.FileName =
"\"cscript.exe\""; works all right but not in string Arguments3

Thanks for any advices.
Bruno

Feb 3 '06 #2
Hi Clive,

Thanks for answering

I gonne test right now with 2 quotes

string Arguments3 = @"%OvAgentDir%\bin\OpC\cmds\ref-ovo-services.vbs
""ServiceApplicatif"" ServiceOVO";

Have a good day
Bruno

Feb 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: NikkoW | last post by:
I need to assign a string to a variable but the text string includes quotation marks: Example: MyString = "He turned and said "Hello" before leaving." When the compiler hits the quotation...
8
by: Stephen Poley | last post by:
One disadvantage of using a simple text editor to produce HTML is that it is relatively time-consuming to put in the proper typographical quotation marks and dashes. A round tuit having arrived...
63
by: Tristan Miller | last post by:
Greetings. Do any popular browsers correctly support <q>, at least for Western languages? I've noticed that Mozilla uses the standard English double-quote character, ", regardless of the lang...
7
by: Paradigm | last post by:
I am trying to create a recordset where some text fields are matching. The problem is that some of the text fields contain quotation marks. I have tried to create the sql string using replace eg....
2
by: Dixie | last post by:
Hi, I am tyring to write some generic code that will send the source SQL for a mailmerge to a Word template. I am trying to use DLookup to insert the query name that is the record source for the...
4
by: | last post by:
Hi, How do I trim double quotation mark " in a string? Or, how do I match pattern if the string has double quotation mark already like "string"? Thanks in advance. Hugh
3
by: Ufit | last post by:
Simple,dumm question - how to include quotation marks in the string? F.ex. "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\client data.mdf";Integrated Security=True;User Instance=True" I get syntax...
31
by: The Bicycling Guitarist | last post by:
Hi. For many years I have been using &quot; for double quotation marks in the HTML code, but the opening and closing quotation marks render the same in my browser. I'm considering going through and...
12
by: Adam Right | last post by:
Hi ! In my sql statement, i have to use field names and table name with quotation marks. like that : ----------------------------------------------------------------------- string sqlStr = ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.