Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing input parameter to batch file that contains equal sign

Posted on 2007-03-30
6
Medium Priority
?
3,718 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 750 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Make the most of your online learning experience.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

688 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