'&' Char In Batch File

R

rasimg

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%
 
R

rasimg

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%
 
R

rasimg

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%
 
R

rasimg

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%
 
R

rasimg

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%
 
B

billious

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_ressr...1&subres=ss_193301&heartbeat=3500&recov=false

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

-labres http://64.107.55.37:9903/labl_ressrv_1/NuMegSS3/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_ressr...1&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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top