Link to home
Start Free TrialLog in
Avatar of RudePuppyDog
RudePuppyDog

asked on

Passing input parameter to batch file that contains equal sign

I have the following command from a UNIX system that will launch a batch file on a Windows system.
The batch file simply calls up an IE session with the URL that is the input parameter to the batch file.

rsh hostname -l username c:\\temp\\test.bat "http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy"

The problem is that the batch file does not recognize the "=" sign
It also gives me this
    'DEF'' is not recognized as an internal or external command
so it may be having trouble with the "&" sign.

How can i pass a URL to a batch file where the URL contains "=" and "&" signs?
Avatar of jkr
jkr
Flag of Germany image

I assume there is a problem with the contents of the batch file. If you just use

set URL=%1
echo %URL%

and call that like

test "http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy"

that works fine.
Avatar of RudePuppyDog
RudePuppyDog

ASKER

When it opens the IE window, the URL is

http://xxx.xxxl.com/Add.asp?ABC
      so I think its getting confused with the "=" in the URL

set URL=http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy    would have multiple "=" signs.

Even

set URL=%1
echo %URL%

"%ProgramFiles%\Internet Explorer\iexplore.exe" %URL%

as the batch file works fine.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Closer, but when I escape the quotes on the UNIX side, the browsers opens up with the following URL:
       http://xxx.xxxl.com/Add.asp?ABC=xx

Its dropping the "&" and everything after that.