473,382 Members | 1,650 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,382 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 6274
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 = ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...

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.