Solved

Passing input parameter to batch file that contains equal sign

Posted on 2007-03-30
6
3,644 Views
Last Modified: 2013-12-04
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?
0
Comment
Question by:RudePuppyDog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 18824882
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.
0
 

Author Comment

by:RudePuppyDog
ID: 18825516
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.

0
 
LVL 86

Expert Comment

by:jkr
ID: 18825572
Even

set URL=%1
echo %URL%

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

as the batch file works fine.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 18825579
Note that you need the quotes, though. I assume that the rsh command expansion removes them, try to escape them on the UN*X side as

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

Author Comment

by:RudePuppyDog
ID: 18840518
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.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Starting up a Project

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question