PC Review


Reply
Thread Tools Rate Thread

'&' Char In Batch File

 
 
moleskyca1@yahoo.com
Guest
Posts: n/a
 
      13th Jul 2007
I have URL string like this in my batch file as parameter to another
program:

set APP_PARAMS=-labres
http://64.107.55.37:9903/labl_ressrv...00&recov=false

echo %APP_PARAMS%
The problem is char '&'. The output is:

-labres http://64.107.55.37:9903/labl_ressrv...GET?res=193301

Everything after the '&' is gone. How can I fix this?

Thank you.

 
Reply With Quote
 
 
 
 
rasimg@yandex.ru
Guest
Posts: n/a
 
      13th Jul 2007
On 13 , 17:44, molesky...@yahoo.com wrote:
> I have URL string like this in my batch file as parameter to another
> program:
>
> set APP_PARAMS=-labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres...
>
> echo %APP_PARAMS%
> The problem is char '&'. The output is:
>
> -labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301
>
> Everything after the '&' is gone. How can I fix this?
>
> Thank you.


@echo off
set "APP_PARAMS=http://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?
res=193301&subres..."
set "APP_PARAMS=%APP_PARAMS:&=^&%"

echo %APP_PARAMS%

 
Reply With Quote
 
rasimg@yandex.ru
Guest
Posts: n/a
 
      13th Jul 2007
On 13 , 17:44, molesky...@yahoo.com wrote:
> I have URL string like this in my batch file as parameter to another
> program:
>
> set APP_PARAMS=-labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres...
>
> echo %APP_PARAMS%
> The problem is char '&'. The output is:
>
> -labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301
>
> Everything after the '&' is gone. How can I fix this?
>
> Thank you.


@echo off
set "APP_PARAMS=http://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?
res=193301&subres..."
set "APP_PARAMS=%APP_PARAMS:&=^&%"

echo %APP_PARAMS%

 
Reply With Quote
 
rasimg@yandex.ru
Guest
Posts: n/a
 
      13th Jul 2007
On 13 , 17:44, molesky...@yahoo.com wrote:
> I have URL string like this in my batch file as parameter to another
> program:
>
> set APP_PARAMS=-labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres...
>
> echo %APP_PARAMS%
> The problem is char '&'. The output is:
>
> -labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301
>
> Everything after the '&' is gone. How can I fix this?
>
> Thank you.


@echo off
set "APP_PARAMS=http://64.107.55.37:9903_&_subres"
set "APP_PARAMS=%APP_PARAMS:&=^&%"

echo %APP_PARAMS%

 
Reply With Quote
 
rasimg@yandex.ru
Guest
Posts: n/a
 
      13th Jul 2007
On 13 , 17:44, molesky...@yahoo.com wrote:
> I have URL string like this in my batch file as parameter to another
> program:
>
> set APP_PARAMS=-labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres...
>
> echo %APP_PARAMS%
> The problem is char '&'. The output is:
>
> -labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301
>
> Everything after the '&' is gone. How can I fix this?
>
> Thank you.


@echo off
set "APP_PARAMS=some string with &_&&"
set "APP_PARAMS=%APP_PARAMS:&=^&%"

echo %APP_PARAMS%

 
Reply With Quote
 
rasimg@yandex.ru
Guest
Posts: n/a
 
      13th Jul 2007
On 13 , 17:44, molesky...@yahoo.com wrote:
> I have URL string like this in my batch file as parameter to another
> program:
>
> set APP_PARAMS=-labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres...
>
> echo %APP_PARAMS%
> The problem is char '&'. The output is:
>
> -labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301
>
> Everything after the '&' is gone. How can I fix this?
>
> Thank you.


@echo off
set "APP_PARAMS=some string with &_&_&"
set "APP_PARAMS=%APP_PARAMS:&=^&%"

echo %APP_PARAMS%

 
Reply With Quote
 
billious
Guest
Posts: n/a
 
      13th Jul 2007

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have URL string like this in my batch file as parameter to another
> program:
>
> set APP_PARAMS=-labres
> http://64.107.55.37:9903/labl_ressrv...00&recov=false
>
> echo %APP_PARAMS%
> The problem is char '&'. The output is:
>
> -labres http://64.107.55.37:9903/labl_ressrv...GET?res=193301
>
> Everything after the '&' is gone. How can I fix this?
>
> Thank you.
>


NT4/2K/XP/2K3 (NT+ systems) are discussed in alt.msdos.batch.nt as the
techniques used differ markedly from DOS/9x methods.

----- batch begins -------
[1]@echo off
[2]set APP_PARAMS="-labres
http://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres=ss_193301&heartbeat=3500&recov=false"
[3]for /f "tokens=1*delims==" %%i in ( ' set app_params ' ) do echo %%~j
------ batch ends --------

Lines start [number] - any lines not starting [number] have been wrapped
and should be rejoined. The [number] that starts the line should be removed

The spaces surrounding the single-quotes are for emphasis only. The SPACES
are not required but the single-quotes ARE required.




 
Reply With Quote
 
moleskyca1@yahoo.com
Guest
Posts: n/a
 
      13th Jul 2007
On Jul 13, 9:22 am, ras...@yandex.ru wrote:
> On 13 , 17:44, molesky...@yahoo.com wrote:
>
> > I have URL string like this in my batch file as parameter to another
> > program:

>
> > set APP_PARAMS=-labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301&subres...

>
> > echo %APP_PARAMS%
> > The problem is char '&'. The output is:

>
> > -labreshttp://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/GET?res=193301

>
> > Everything after the '&' is gone. How can I fix this?

>
> > Thank you.

>
> @echo off
> set "APP_PARAMS=http://64.107.55.37:9903_&_subres"
> set "APP_PARAMS=%APP_PARAMS:&=^&%"
>
> echo %APP_PARAMS%


Great. This works.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to permanently delete char char char char style in MS Word? =?Utf-8?B?Q3Jpcw==?= Microsoft Word Document Management 6 12th Jun 2011 09:47 PM
A script/batch to kill a batch file from scheduled tasks? Bogdan Windows XP Configuration 1 31st Jul 2009 06:05 AM
Ever seen "Char Char Char Char Char Char1 Char Char Ch" style? =?Utf-8?B?TWFyaWx5bg==?= Microsoft Word Document Management 2 4th Oct 2006 04:47 PM
Formatting changed to Char Char Char Char... =?Utf-8?B?TWVsaXNzYQ==?= Microsoft Word Document Management 10 14th Apr 2006 07:32 AM
Batch for swap char. Alan Tang Microsoft Windows 2000 CMD Promt 4 22nd Sep 2003 11:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:32 AM.