473,387 Members | 1,493 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,387 software developers and data experts.

file paths and verbatim literals problem

Hi!

I have and issue with passing quoted path to a extern application via
Process.Start.
When I pass argument as:
@" -o c:\test.tif c:\_script.txt c:\test.jpg "

everything works fine but I have to pass paths in quotes ... it must look
like this:

-o "c:\test.tif " "c:\_script.txt" "c:\test.jpg "

so I write this:
@" -o ""c:\test.tif"" ""c:\_script.txt"" ""c:\test.jpg"" "

but output then looks like this:
" -o \"c:\\test.tif\" \"c:\\_script.txt\" \"c:\\test.jpg\" "

as You see I got double backshlashes and single backslashes on a places
where they shouldn't be.
Any suggestions .... I'm really stuck .... again!
Thanks!
Nov 16 '05 #1
3 1003
CroDude <di***********@zg.htnet.hr> wrote:
I have and issue with passing quoted path to a extern application via
Process.Start.
When I pass argument as:
@" -o c:\test.tif c:\_script.txt c:\test.jpg "

everything works fine but I have to pass paths in quotes ... it must look
like this:

-o "c:\test.tif " "c:\_script.txt" "c:\test.jpg "

so I write this:
@" -o ""c:\test.tif"" ""c:\_script.txt"" ""c:\test.jpg"" "

but output then looks like this:
" -o \"c:\\test.tif\" \"c:\\_script.txt\" \"c:\\test.jpg\" "

as You see I got double backshlashes and single backslashes on a places
where they shouldn't be.
Any suggestions .... I'm really stuck .... again!


See http://www.pobox.com/~skeet/csharp/s....html#debugger

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Try using this:

"-o \"c:\\test.tif \" \"c:\\_script.txt\" \"c:\\test.jpg \""

Ciaran

"CroDude" <di***********@zg.htnet.hr> wrote in message
news:cr**********@news1.xnet.hr...
Hi!

I have and issue with passing quoted path to a extern application via
Process.Start.
When I pass argument as:
@" -o c:\test.tif c:\_script.txt c:\test.jpg "

everything works fine but I have to pass paths in quotes ... it must look
like this:

-o "c:\test.tif " "c:\_script.txt" "c:\test.jpg "

so I write this:
@" -o ""c:\test.tif"" ""c:\_script.txt"" ""c:\test.jpg"" "

but output then looks like this:
" -o \"c:\\test.tif\" \"c:\\_script.txt\" \"c:\\test.jpg\" "

as You see I got double backshlashes and single backslashes on a places
where they shouldn't be.
Any suggestions .... I'm really stuck .... again!
Thanks!

Nov 16 '05 #3
Interesting and helpfull!

Thanks ... It works fine!
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
CroDude <di***********@zg.htnet.hr> wrote:
I have and issue with passing quoted path to a extern application via
Process.Start.
When I pass argument as:
@" -o c:\test.tif c:\_script.txt c:\test.jpg "

everything works fine but I have to pass paths in quotes ... it must look like this:

-o "c:\test.tif " "c:\_script.txt" "c:\test.jpg "

so I write this:
@" -o ""c:\test.tif"" ""c:\_script.txt"" ""c:\test.jpg"" "

but output then looks like this:
" -o \"c:\\test.tif\" \"c:\\_script.txt\" \"c:\\test.jpg\" "

as You see I got double backshlashes and single backslashes on a places
where they shouldn't be.
Any suggestions .... I'm really stuck .... again!


See http://www.pobox.com/~skeet/csharp/s....html#debugger

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #4

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

Similar topics

11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
1
by: Cortes | last post by:
hi all, I have a variable, let's call it xyz, as a string. I want xyz to be a string which I copied from a website that has a lot of back slashes, forward slashes, single quotes, double...
4
by: fred | last post by:
Hi, is there a way to put " (double quote) into a verbatin string? thank you
1
by: Mark Rae | last post by:
Hi folks, Apologies - am having a bit of a "senior moment"... Is there a way to convert a string containing escaped characters into a verbatim string literal? I.e. converting something like...
7
by: JIM.H. | last post by:
\\MyRemoteServer\F1\F2\F3\This PDF.pdf is accessible thought my IE browser, so my user has access there. However the following code gives "Logon failure: unknown user name or bad password.\r\n" I...
5
by: Eugene Anthony | last post by:
ds1.Tables.Rows.ItemArray.GetValue(0).ToString() contains the string path: images/5/Video1/qbert.flv if (File.Exists(ds1.Tables.Rows.ItemArray.GetValue(0).ToString())) { //code to execute } ...
16
by: Hans Fredrik Nordhaug | last post by:
I'm trying to write to a file in the current directory - no remote files. The subject says it all - I can add that both the directory and the file is wordwritable. This happens on a (quite good)...
4
by: rgw1 | last post by:
Hello, Can anyone help with this? I am using C# with IIS 6.0 on Windows 2003 Server. I am trying to copy a file over the network. It is attempting to copy a file on a NAS (external hard...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
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: 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...
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
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,...
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,...

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.