Solved

Passing input parameter to batch file that contains equal sign

Posted on 2007-03-30
6
3,388 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now