Connecting Tech Pros Worldwide Forums | Help | Site Map

String manipulation

Lee
Guest
 
Posts: n/a
#1: Nov 17 '05
Hi All,

I need to make a string look like this. I am calling a program and need to
send args to it.

"c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt"

The quotes need to be passed exactly as they are in that string or it will
not work. I need the quotes or I end up getting things trucated.

Thanks

Lee



Jared Parsons [MSFT]
Guest
 
Posts: n/a
#2: Nov 17 '05

re: String manipulation


Try

@"""c:\program files\program dir\prog.exe"" /B ""c:\config
files\file1.txt"""
--
Jared Parsons [MSFT]
jaredpar@online.microsoft.com
http://blogs.msdn.com/jaredpar
"This posting is provided "AS IS" with no warranties, and confers no rights"
"Lee" <latrotter@spamless.sympatico.ca> wrote in message
news:eWfG8dMUFHA.2124@TK2MSFTNGP14.phx.gbl...[color=blue]
> Hi All,
>
> I need to make a string look like this. I am calling a program and need
> to send args to it.
>
> "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt"
>
> The quotes need to be passed exactly as they are in that string or it will
> not work. I need the quotes or I end up getting things trucated.
>
> Thanks
>
> Lee
>[/color]


Lee
Guest
 
Posts: n/a
#3: Nov 17 '05

re: String manipulation


This is what I get that that:

"\"C:\\program files\\program dir\\prog.exe\" /B \"C:\\config
files\\files1.txt\""

That is right out of the watch window

"Jared Parsons [MSFT]" <jaredpar@online.microsoft.com> wrote in message
news:Olkq0iMUFHA.752@TK2MSFTNGP10.phx.gbl...[color=blue]
> Try
>
> @"""c:\program files\program dir\prog.exe"" /B ""c:\config
> files\file1.txt"""
> --
> Jared Parsons [MSFT]
> jaredpar@online.microsoft.com
> http://blogs.msdn.com/jaredpar
> "This posting is provided "AS IS" with no warranties, and confers no
> rights"
> "Lee" <latrotter@spamless.sympatico.ca> wrote in message
> news:eWfG8dMUFHA.2124@TK2MSFTNGP14.phx.gbl...[color=green]
>> Hi All,
>>
>> I need to make a string look like this. I am calling a program and need
>> to send args to it.
>>
>> "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt"
>>
>> The quotes need to be passed exactly as they are in that string or it
>> will not work. I need the quotes or I end up getting things trucated.
>>
>> Thanks
>>
>> Lee
>>[/color]
>
>[/color]


Jared Parsons [MSFT]
Guest
 
Posts: n/a
#4: Nov 17 '05

re: String manipulation


That's still the program representation. If you print that string out, say
to the console, it should be as you specified

--
Jared Parsons [MSFT]
jaredpar@online.microsoft.com
http://blogs.msdn.com/jaredpar
"This posting is provided "AS IS" with no warranties, and confers no rights"
"Lee" <latrotter@spamless.sympatico.ca> wrote in message
news:efaj1nMUFHA.3140@TK2MSFTNGP14.phx.gbl...[color=blue]
> This is what I get that that:
>
> "\"C:\\program files\\program dir\\prog.exe\" /B \"C:\\config
> files\\files1.txt\""
>
> That is right out of the watch window
>
> "Jared Parsons [MSFT]" <jaredpar@online.microsoft.com> wrote in message
> news:Olkq0iMUFHA.752@TK2MSFTNGP10.phx.gbl...[color=green]
>> Try
>>
>> @"""c:\program files\program dir\prog.exe"" /B ""c:\config
>> files\file1.txt"""
>> --
>> Jared Parsons [MSFT]
>> jaredpar@online.microsoft.com
>> http://blogs.msdn.com/jaredpar
>> "This posting is provided "AS IS" with no warranties, and confers no
>> rights"
>> "Lee" <latrotter@spamless.sympatico.ca> wrote in message
>> news:eWfG8dMUFHA.2124@TK2MSFTNGP14.phx.gbl...[color=darkred]
>>> Hi All,
>>>
>>> I need to make a string look like this. I am calling a program and need
>>> to send args to it.
>>>
>>> "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt"
>>>
>>> The quotes need to be passed exactly as they are in that string or it
>>> will not work. I need the quotes or I end up getting things trucated.
>>>
>>> Thanks
>>>
>>> Lee
>>>[/color]
>>
>>[/color]
>
>[/color]


Closed Thread