473,769 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quotation marks in string arguments


My Windows service includes the following lines:

string Arguments3 = @"%OvAgentDir%\ bin\OpC\cmds\re f-ovo-services.vbs
ServiceApplicat if ServiceOVO";
string expandedArgumen ts3 =
Environment.Exp andEnvironmentV ariables(Argume nts3);
this.process3.S tartInfo.Argume nts = expandedArgumen ts3;
this.process3.S tartInfo.FileNa me = "cscript.ex e";

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

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

\" on both sides of the command in this.process3.S tartInfo.FileNa me =
"\"cscript.exe\ ""; works all right but not in string Arguments3

Thanks for any advices.
Bruno

Feb 3 '06 #1
2 6298
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*******@gmai l.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...

My Windows service includes the following lines:

string Arguments3 = @"%OvAgentDir%\ bin\OpC\cmds\re f-ovo-services.vbs
ServiceApplicat if ServiceOVO";
string expandedArgumen ts3 =
Environment.Exp andEnvironmentV ariables(Argume nts3);
this.process3.S tartInfo.Argume nts = expandedArgumen ts3;
this.process3.S tartInfo.FileNa me = "cscript.ex e";

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

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

\" on both sides of the command in this.process3.S tartInfo.FileNa me =
"\"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\re f-ovo-services.vbs
""ServiceApplic atif"" 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
3417
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 marks in front of Hello, it assumes the string is over and generates and error on the remainder. I must use the double quotes " in my string and not the single ' so that isn't an option. How can I avoid this? Thanks in advance from a noob thrasher!
8
3038
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 on my desk, I've produced a couple of sed scripts to automatically convert the 'typewriter' equivalents: http://www.xs4all.nl/~sbpoley/webmatters/proper_quotes.html I've tested them fairly thoroughly, but I'd be grateful if a few other
63
5911
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 attribute of the HTML document. Will any browsers render German-style quotes or French-style guillemots for lang="de" and lang="fr", respectively? Regards, Tristan
7
11593
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. "SELECT * FROM MYTABLE WHERE REPLACE(MYFIELD,"""",".") = """ & REPLACE(MYTEXT,"""",".") & """" but this does not work. Trying to replace the quotation marks with some other character in this case the stop How can I embed the quotation marks in...
2
4294
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 mailmerge with Word. The code I am working with is as follows. This code works. wrdDoc.MailMerge.OpenDataSource Name:=CurrentProject.Path & "\" & DLookup("", "tblSetUp", "ID=88"), LinkToSource:=True, Connection:="QUERY MyQuery",...
4
3777
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
3535
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 error. Thanks for help Ufi
31
4891
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 using &ldquo; and &rdquo; (in pairs as needed) instead. Are there any *disadvantages* to doing so, besides the time it will take to make the change? Thanks.
12
3582
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 = "Select \"Person Name Field\", \"Age Field" from \"Old Table\" "; cmd.CommandText = sqlStr; -----------------------------------------------------------------------
0
9590
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3968
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 we have to send another system

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.